I've found myself a nice description of how QuickSort works,
http://www.equestionanswers.com/c/c-quick-sort.php
put in in a(n assembly) program and, as a test, used it on a (worst case) reverse-sorted list.
It turned out to be painfully slow (taking many seconds)... :-( I could see the "high" marker move down one step at the time, making it a very time-consuming, lineair-is process.
In comparision DPA_Sort sorts the above list in a fraction of a second.
What can I do / have I missed ?
Hello all,
I've found myself a nice description of how QuickSort works,
http://www.equestionanswers.com/c/c-quick-sort.php
put in in a(n assembly) program and, as a test, used it on a (worst case) reverse-sorted list.
It turned out to be painfully slow (taking many seconds)... :-( I could see the "high" marker move down one step at the time, making it a very time-consuming, lineair-is process.
In comparision DPA_Sort sorts the above list in a fraction of a second.
What can I do / have I missed ?
For things like this -- algorithms and such -- I always suggest
checking Rosetta Code:
Quicksort has pathological cases. A reverse-sorted list is one of them.
https://www.geeksforgeeks.org/when-does-the-worst-case-of-quicksort-occur/
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 741 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 69:11:25 |
| Calls: | 12,448 |
| Calls today: | 3 |
| Files: | 15,194 |
| Messages: | 6,537,590 |