0
How can we convert non stable comparison based algorithm to stable algorithm .
I read on geeks for geeks that it can be done but nowhere is given how can we do it... mean no illustrative idea of such topics why....
1 Réponse
0
It depends on your algorithm. A stable algorithm is holding its order after sorting again, for example:
Oder by name:
Alex 4
Amber 3
Bryan 3
Cecil 2
David1
If you order with a stable algorithm after numbers, Amber will stay before Bryan. How you implement this, is your challenge. And quicksort as an example is hardly ever stable.