How is stable_partition an adaptive algorithm?

后端 未结 3 895
一生所求
一生所求 2021-01-20 01:39

stable_partition is a function template present in algorithm header file of c++ STL. I read that it is an adaptive algorithm and its time complexity is O(n*logn) or O(n) dep

3条回答
  •  逝去的感伤
    2021-01-20 02:28

    See here :

    Exactly last-first applications of the predicate and at most (last-first)*log(last-first) swaps if there is insufficient memory or linear number of swaps if sufficient memory is available.

提交回复
热议问题