How to Compare Contents of Two Files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #16
    Originally posted by CodeTilYaDrop
    You all are great helpers! I really appreciate it!

    Can I ask you about one more thing. I was reading about an inner and outer loop to compare items in arrays. Do you know where to find the algorithm for this, too? This might help me too!
    You do realize that an inner loop is simply a loop started within another loop? There is no algorithm for it as such but the moment you start a loop inside another loop then that loop becomes an inner loop and the first one is the outer loop.

    Comment

    • CodeTilYaDrop
      New Member
      • Aug 2007
      • 66

      #17
      Yes, I have used it before, but I am not too sure about how it works to well. I was hoping someone could point me to a good article on it. I am not too familar with how it works, and I would like to better understand it.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #18
        Originally posted by CodeTilYaDrop
        Yes, I have used it before, but I am not too sure about how it works to well. I was hoping someone could point me to a good article on it. I am not too familar with how it works, and I would like to better understand it.
        Just go through Sun's tutorial.

        Comment

        • CodeTilYaDrop
          New Member
          • Aug 2007
          • 66

          #19
          I am pretty good with using one for statement in a program, but I get confused when I start using more than one. Do you have any good examples to point out for more than one?? Man, I have a lot to learn here!

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #20
            Originally posted by CodeTilYaDrop
            I am pretty good with using one for statement in a program, but I get confused when I start using more than one. Do you have any good examples to point out for more than one?? Man, I have a lot to learn here!
            For that page that I gave you just hit next and you'll get to some parts where nested loops are used. You'll also learn some things there as well along the way. Also try out some programs that involve arrays and require nested loops. Things are generally easier to learn if you practice them on the compiler as well.

            Comment

            • CodeTilYaDrop
              New Member
              • Aug 2007
              • 66

              #21
              I see them now! I will take a look, and I will heed your advice on practice. I don't think I practice everything as much as I should!! Thanks again for all your help! You all are the Best!

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #22
                I don't want to discourage you but I'm afraid that a decent 'diff' algorithm is a bit
                way over your head right now. First study what loops (within loops) are all about
                and realize that they're nothing special. A largest common substring algorithm
                (and an efficient implementation thereof) is out of reach for now.

                kind regards,

                Joa

                Comment

                • CodeTilYaDrop
                  New Member
                  • Aug 2007
                  • 66

                  #23
                  I gotcha....your great help!!! thank you two -

                  Comment

                  • JosAH
                    Recognized Expert MVP
                    • Mar 2007
                    • 11453

                    #24
                    Originally posted by CodeTilYaDrop
                    I gotcha....your great help!!! thank you two -
                    About those nested loops: think how you would visit all squares on a chessboard
                    or similar. Think of rectangular (non-square) boards; how would you visit all the
                    cells? Think of a loop per row and an inner loop per column. Try it the other way
                    around and see in what order the cells are visited. Try to do it with a single loop.
                    Print out all the index values and see what happens.

                    kind regards,

                    Jos

                    Comment

                    • ksamir2004
                      New Member
                      • Feb 2008
                      • 3

                      #25
                      How to compare two files in java & uncommon thing should print in text file..

                      thanks
                      Samir

                      Comment

                      • r035198x
                        MVP
                        • Sep 2006
                        • 13225

                        #26
                        Originally posted by ksamir2004
                        How to compare two files in java & uncommon thing should print in text file..

                        thanks
                        Samir
                        Have you read this thread at all?

                        Comment

                        • JosAH
                          Recognized Expert MVP
                          • Mar 2007
                          • 11453

                          #27
                          Originally posted by ksamir2004
                          How to compare two files in java & uncommon thing should print in text file..

                          thanks
                          Samir
                          Why ask again in someone else's thread? You also started your own thread for
                          your question. Stick to it please.

                          kind regards,

                          Jos

                          Comment

                          Working...