Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radix Sort in Java

Status
Not open for further replies.

Javahelplease

Programmer
Sep 30, 2002
1
US
I have to implement a sorting algorithm called radixsort in Java. My problem is...

I have to select one appropriate kind of linked list(singly-linked, doubly-linked, circular, etc.)to represent the master list and the buckets. And explain my choice.

I'm thinking the linked list should be a doubly-linked list, but not sure. Could some please please verify and provide the reason why? I'm a bit confused cause I think all the linked list should work.

Please help.
 
you only need a singly-linked list

if you take some numbers perferb(100-999) and go through the steps, you will see that there is no need to access elements between the nodes, you only need to access the first element in order from the linked list. You don't need to re-link anything or add anything in between nodes.

You can actually implement a radix sort using a Queue (FIFO)

"so many events, so little time"
 
you only need a doubly linked list if you need to go backwards. ie insertion, deletion or backwards traversal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top