Partial sort of std::list

后端 未结 2 1277
野性不改
野性不改 2021-01-12 09:19

I have a linked list that I want to sort part of, eg:

std::sort(someIterator, otherIterator, predicate);

std::sort requires random-access i

相关标签:
2条回答
  • 2021-01-12 10:13

    Yes, but you will have to use a merge sort.

    0 讨论(0)
  • 2021-01-12 10:17

    How about unhooking the part of the list that you want sorted, into a standalone list, then use the specialized list sort, then hook it back into the original list?

    0 讨论(0)
提交回复
热议问题