Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i dont know how to sort doubly link list. and i need and want to learn how to sort doubly link list.
kindly do me a favour. thanks
Posted
Comments
[no name] 24-Mar-11 5:24am    
You can build sorted list, if you will sort (insert in correct location) it while inserting new element.
Niklas L 24-Mar-11 9:06am    
A different approach would be to implement random access iterators for your list, and then use a standard sort from algorithm header, but I guess you are focusing on the sorting algoritm.

You could use Merge sort as one option. See http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html[^].
 
Share this answer
 
Comments
Espen Harlinn 24-Mar-11 5:02am    
To the point, my 5
 
Share this answer
 
Comments
Espen Harlinn 24-Mar-11 5:02am    
5ed, good point :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900