I would like to sort a simple linked list using swap-sort method what in arrays would be:
I know how to do it using arrays but I a unable to make it work using simple linked lists.Code:for (i=MIN; i<MAX; i++) { for (j=MIN; j<MAX-1; j++) { if v[j] > v[j+1] { aux ← v[j] ; v[j] ← v[j+1]; v[j+1] ← aux; } } }
Any ideas?