how can I add a counter to the shell sort or insertion sort tha counts the number of compariisons that are made?
Thanx for your reply but I still need another answer:how can I modifyu the program to solve four pole tower of hannoi?
Let me be bad, the Bubble Sort is the best algorithm for near sorted lists. This means, if the elements are in there places or really near and you need the list sorted (is used in games and military area), Bubble Sort may be your choise since works locally. Most of the other algorithm work globally.