vba - it about sorting algorithm -
what happens identical items in sort? (sorting algorithm) example following list after has been sorted in ascending order: (f, g, a, r, s, g, a, x)
it depends on sorting algorithm use.
some algorithms stable means equal distinct items stay in same order started. others unstable means order may change.
in example, you'd end (a, a, f, g, g, r, s, x) can't tell difference between equal elements. suppose instead start (f1, g1, a1, r1, s1, g2, a2, x1) , sort first letters. stable sort guarantee ended (a1, a2, f1, g1, g2, r1, s1, x1) - whereas unstable sort end (a2, a1, f1, g1, g2, r1, s1, x1) or similar.
see wikipedia sorting entry more information, , details stability of various algorithms.
Comments
Post a Comment