Announcement

Collapse
No announcement yet.

Need help with Java

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with Java

    Does anyone know where I can find the sourcecode for Quick Search, Merge Search and Heap Search?

    I need the source code, because our teachers told us to download them from the internet, and we should comment the different lines in the code, so they know we understand it. Our assignment isn't based on the "do-it-yourself", because we didn't have enough time for this assignment to actually do it ourself.

    Does anyone know where I can find those?
    This space is empty... or is it?

  • #2
    Sorry, a quick search (grin) with google didn't turn up anything interesting with any of them.
    I'm building a wagon! On some other part of the internets, obviously (but not that other site).

    Comment


    • #3
      Goldmine!



      and if that doesn't help, some more from sun
      This collections Java tutorial describes interfaces, implementations, and algorithms in the Java Collections framework
      I'm building a wagon! On some other part of the internets, obviously (but not that other site).

      Comment


      • #4
        Thx, I'll take a look
        This space is empty... or is it?

        Comment


        • #5
          Do you know an easy way to compile SortAlgorithm.jav and SortItem.java?

          I can't find them as class files, and I can't compile them because file1 needs file2, and file2 needs file1
          This space is empty... or is it?

          Comment


          • #6
            Nevermind, found the way
            This space is empty... or is it?

            Comment


            • #7
              how?
              Concrete, Abstract, or Squoingy?
              "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

              Comment


              • #8
                By opening the files in a project (I'm using JCreator)
                This space is empty... or is it?

                Comment


                • #9
                  cunning
                  Concrete, Abstract, or Squoingy?
                  "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                  Comment


                  • #10
                    Could someone please take a look at my code and tell me what's wrong here?


                    Tester.java is the execution file.
                    I'm having problems with HeapSort.java

                    I have included a lot of System.out.println's to find the error, but I can't seem to find anything wrong in the code.

                    For some strange reason it just stops in the middle of the for-loop in heapSort method

                    Can someone see what's wrong here?
                    This space is empty... or is it?

                    Comment


                    • #11
                      Shouldn't you use v[] instead of data[] inside HeapSort?
                      (\__/) 07/07/1937 - Never forget
                      (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                      (")_(") "Starting the fire from within."

                      Comment


                      • #12
                        Uhmm... I guess so, but this doesn't make any difference. The problem is the pause(); methods. I don't understand why they're included. If I don't include them it goes on forever, but if I include them, the program ends with a pause(); (Using the System.out.println("Pause1"); line in the pause(); method)
                        This space is empty... or is it?

                        Comment


                        • #13
                          Which line exactly does it stop at, or which for loop?
                          What are the variables doing just before it stops responding?

                          Have your println call display the values of the variables used in that particular section of code, it should help point out the problem.
                          I'm building a wagon! On some other part of the internets, obviously (but not that other site).

                          Comment


                          • #14
                            In HeapSort line 101 it calls the medhod pause(), which is line 61 - 67 in class SortAlgorithm

                            The last thing it does before stopping is printing "Pause1" (line 65). I have checked, it doesn't enter this:

                            if (stopRequested)
                            {
                            throw new Exception("Sort Algorithm");
                            }
                            This space is empty... or is it?

                            Comment


                            • #15
                              The pause() method is part of Java's AWT. It seems like it was included to be used as part of some sorting demo program. I think you can take it out.
                              (\__/) 07/07/1937 - Never forget
                              (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                              (")_(") "Starting the fire from within."

                              Comment

                              Working...
                              X