Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    Try doing some debugging by adding some println statements that print out everything that is read so you can see what the computer sees when the code is executed.

    What about this:
    Also please...
  2. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    Also please post the program's output for that input file and add comments saying what is wrong with it and show what it should be.
  3. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    The input file is too big. Can you minimize it?
  4. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    How can the code be tested? Where is the source file to compile and execute and the input for it?
  5. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    To make it easier to see the problem, reduce the size of the input file to a minimum: say with one good entry and one that shows the problem.
    Execute the program, copy the output and paste it here...
  6. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    One possible problem that the compiler should be warning you about is the missing break statement.

    Every call to nextLine() reads a line. The code only prints out every other line.
    To see all...
  7. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    Good point about using nextLine() after nextInt()
  8. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    What is the format of the line that has the key and the name?
    Is this it:
    key<space>name
    where <space> is the char: ' '

    The String class has methods to:
    1) find the <space>
    2) get the...
  9. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    Are you having any problems doing that?


    Sorry, I don't know what you mean by "heap".
  10. Replies
    24
    Views
    1,413

    Re: Help with hashmap and heap

    What do you want as the key and what as the value for the lines in the file when they are placed in the HashMap?
    Is the problem separating the String that was read in from the file into the key and...
Results 1 to 10 of 10