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: | 715 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 168:08:44 |
| Calls: | 12,096 |
| Calls today: | 4 |
| Files: | 15,003 |
| Messages: | 6,517,822 |