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: | 796 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 159:34:30 |
| Calls: | 13,194 |
| Calls today: | 1 |
| Files: | 15,485 |
| Messages: | 6,579,442 |