Results 1 to 1 of 1
Thread: most effective method?
- 12-04-2010, 09:47 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 7
- Rep Power
- 0
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
Similar Threads
-
Strategic & Effective Internet Marketing Solutions - PPC, Email Marketing
By outsourceendrew in forum Reviews / AdvertisingReplies: 0Last Post: 07-13-2010, 07:04 AM -
Turning Recursion Method into Iterative method
By mattakuevan in forum New To JavaReplies: 9Last Post: 06-15-2010, 06:46 AM -
method not abstract, does not override actionperformed method.
By Theman in forum New To JavaReplies: 2Last Post: 03-26-2010, 05:12 PM -
ArrayLists compareTo method, equals method
By random0munky in forum New To JavaReplies: 2Last Post: 10-26-2009, 07:20 PM -
Calling a method in a different class from within a method problem
By CirKuT in forum New To JavaReplies: 29Last Post: 09-25-2008, 07:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks