Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10974

Re: comparing two test files

From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: comparing two test files
Date 2011-12-23 07:50 -0800
Organization A noiseless patient Spider
Message-ID <jd27vk$l5p$1@dont-email.me> (permalink)
References <5fdf65a2-052b-4c0b-b6bf-bc4dc8a7dd02@v24g2000prn.googlegroups.com>

Show all headers | View raw


On 12/23/2011 12:45 AM, ruds wrote:

> it iterates through the first file but doest not enter the second
> while loop after reading once onle i.e for the first line of first
> file.


Besides the advice above on "how to debug," I think you need some 
practice on making the algorithm in the first place.

Try to compare two files yourself, by hand.  Write down each step as you 
do it.  Leave no detail out, no matter how small!

Then, try to write your steps as a flow chart.  Review what decisions 
you made at each step and include them on the flow chart.  It's very 
important to get these steps in something approximating an algorithm so 
you can start to understand it better.

Next pseudo code is out.  Pay attention here to basic optimization and 
"clean" code, something that looks like an algorithm. Try here to get a 
block structure pseudo code.

Then go back to the first step, where you just wrote down your steps, 
and try some new inputs.  Files with different things in them.  Make 
sure each of your steps still works.  If not, then change to so it does. 
  Check your flowchart for the same files.  Make sure the flow chart 
works.  Then check your pseudo code;  did it also work or not?

Taking the difference of two files is actually a hard problem.  You 
should expect to make a considerable effort to get it right.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

comparing two test files ruds <rudranee@gmail.com> - 2011-12-23 00:45 -0800
  Re: comparing two test files Jeff Higgins <jeff@invalid.invalid> - 2011-12-23 05:27 -0500
    Re: comparing two test files Jeff Higgins <jeff@invalid.invalid> - 2011-12-23 06:03 -0500
  Re: comparing two test files Patricia Shanahan <pats@acm.org> - 2011-12-23 06:37 -0800
    Re: comparing two test files Gene Wirchenko <genew@ocis.net> - 2011-12-23 09:18 -0800
      Re: comparing two test files Patricia Shanahan <pats@acm.org> - 2011-12-23 10:25 -0800
        Re: comparing two test files Gene Wirchenko <genew@ocis.net> - 2011-12-23 11:13 -0800
          Re: comparing two test files Patricia Shanahan <pats@acm.org> - 2011-12-23 11:45 -0800
  Re: comparing two test files markspace <-@.> - 2011-12-23 07:50 -0800

csiph-web