File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Pleas help with array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Pleas help with array" Watch "Pleas help with array" New topic

Pleas help with array

Ronald Pruitt
Ranch Hand

Joined: Jan 15, 2001
Posts: 32
I am working on an assignment that is to make a heap from an array. One thing I must do is if an item is already in the array it is not to be added again, but the value only to be incremented. I have had limited success in that I can get it to increment but the word is also added to the list. Also, when I place the first to values in the list they automatically increment, but elements after that do not. Can anyone help please.

in the test bed I have the following:

which when I ask it to print gives me;
The Heap values are: 1 = (Key-> dog, Count -> 2)
Ronald Pruitt
Ranch Hand

Joined: Jan 15, 2001
Posts: 32
I've continued trying to work on this but to no avail, can anyone help, please
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I'm a little puzzled as to why you are doing this. Would a Map (such as a Hashtable or HashMap) not serve the purpose?

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Pleas help with array
jQuery in Action, 3rd edition