c++ - Does std::sort implement Quicksort? -


possible duplicate:
which type of sorting used in function sort()?

does std::sort implement quicksort?

there 2 algorithms traditionally used.

std::sort use quicksort, or @ least variation on quicksort called introsort, "degenerates" heapsort when recursion goes deep.

from standard:

complexity: o(n log(n)) comparisons.

std::stable_sort use mergesort, because of stability requirement. note mergesort requires space in order efficient.

from standard:

complexity: @ n log2(n) comparisons; if enough memory available, n log(n).

i have yet see std::sort implementing timsort promising , has been adopted in python (crafted in fact), java , android (to date).


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -