Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/articles/cpp-tutorials/)
-   -   Sort Linked List (http://www.go4expert.com/articles/sort-linked-list-t4593/)

cnoobprogrammer 29Mar2012 15:17

Re: Sort Linked List(Simple coding for sorting)
 
Hi.
Your code is nice.
May I ask why do you use 2 for loop in this case?

Appreciate your help!:)

shabbir 29Mar2012 15:44

Re: Sort Linked List(Simple coding for sorting)
 
Quote:

Originally Posted by cnoobprogrammer (Post 93835)
Hi.
Your code is nice.
May I ask why do you use 2 for loop in this case?

Appreciate your help!:)

Have you tried any sorting algorithms?

cnoobprogrammer 29Mar2012 18:29

Re: Sort Linked List(Simple coding for sorting)
 
Ya, I try to check if this value referenced by the pointer is greater than the value referenced by another pointer. But it doesn't work.

cnoobprogrammer 31Mar2012 13:51

Re: Sort Linked List(Simple coding for sorting)
 
Hi can i check with you, the reason for having 2 loop is it because you want to compare the first node with the second node and so on?

Thank you!:)


All times are GMT +5.5. The time now is 19:17.