Re: stable sorting
- Posted by Bernie Ryan <xotron at bluefrognet.net> Feb 26, 2003
- 456 views
Juergen: -- first sort by name xxxxxxxxxxxxxx -- then do the following sequence temp temp = {} -- reverse name and mark for i = 1 to length() do temp[i][1] = statistics[i][1] temp[i][2] = statistics[i][2] end for -- then sort temp = custom_sort(by_mark, temp) -- then reverse the name for i = 1 to length() do statistics[i][1] = temp[i][1] statistics[i][2] = temp[i][2] end for -- now statistics is sorted by name and mark -- A seperate function could be used for swapping Bernie