i heard one of the method is using % and / as predicate when compare the elements, but i dont really understand why use % and /, may anyone explan for me, thx very much!

Printable View

- 11-28-2005gamett711221how do u test sorting algorithm stability
i heard one of the method is using % and / as predicate when compare the elements, but i dont really understand why use % and /, may anyone explan for me, thx very much!

- 11-28-2005Rashakil Fol
1) Take a piece of data.

2) Take a less-than operator that does not use the entire piece of data in comparing.

3) Sort using that less-than operator, with some of the data comparing as equal while containing different parts.

4) Check to see if 'equal' elements' order is preserved.

For example, have your data be strings, and then sort by the lengths of the strings.