Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Thread: Array Histogram

    by Norm
    Replies
    9
    Views
    1,986

    Re: Array Histogram

    Please post the program's output and explain what is wrong with it and show what it should be.
  2. Thread: Array Histogram

    by Norm
    Replies
    9
    Views
    1,986

    Re: Array Histogram

    The index is past the end of the array. Remember array indexes go from 0 to the length-1
  3. Thread: Array Histogram

    by Norm
    Replies
    9
    Views
    1,986

    Re: Array Histogram

    One way would be to make two passes. The first to find the longest, the second to count.
    Another way would be to use parallel arrays, have one array contain the length, and the other the count.

    ...
  4. Thread: Array Histogram

    by Norm
    Replies
    9
    Views
    1,986

    Re: Array Histogram

    Read all the strings and remember the length of the longest one, create the array then read them again and count the lengths.
  5. Thread: Array Histogram

    by Norm
    Replies
    9
    Views
    1,986

    Re: Array Histogram

    Do you know how to use a Map? It would be useful: key=length of String, value=count

    Otherwise use an array. What is the max String length? Have an array with a slot for each length and...
Results 1 to 5 of 5