Results 1 to 1 of 1
Thread: most effective method?
- 12-04-2010, 09:47 PM #1Member
- Join Date
- Dec 2010
- Rep Power
most effective method?
I am using algorithms and sorting methods. I am stuck on the very last bit of my problem.
I have linked list of strings, in this list some strings may be 'angram'. for each node in my list, they have a field 'sorted word' and field 'unsorted word.' i am trying to group together all the nodes that have same 'sorted word', there may be none, or a few or many. i need the most efficient way to do this.
I have tried using hashmap but finding it much too difficult.
I have decided i want to use mergesort. I have managed to print out a list of all my nodes. it shows the sorted and the unsorted words for each node. so all the words that have 'sorted word' field the same are next to each other. i now need to group them together.
what is the fastest way to do this? the only way i think of currently is to take the first string, compare it with its neighbour, if their fields are the same, etc etc.
any advice i would be relieved i have hit brick wall
- By outsourceendrew in forum Reviews / AdvertisingReplies: 0Last Post: 07-13-2010, 07:04 AM
- By mattakuevan in forum New To JavaReplies: 9Last Post: 06-15-2010, 06:46 AM
- By Theman in forum New To JavaReplies: 2Last Post: 03-26-2010, 05:12 PM
- By random0munky in forum New To JavaReplies: 2Last Post: 10-26-2009, 07:20 PM
- By CirKuT in forum New To JavaReplies: 29Last Post: 09-25-2008, 07:55 PM