5 ms·
wait, shell sort is stable?
by waldrews 15y ago
wait, shell sort is stable?
- psykotic 15y agoNo, it is unstable. The striding means that two equal elements can easily be reordered. For example, after 2-sorting [(2,a), (1,b), (1,c)] by the first component you get [(1,c), (1,b), (2,a)].