Is stdlib's qsort recursive?

前端 未结 9 1962
执念已碎
执念已碎 2020-12-30 09:19

I\'ve read that qsort is just a generic sort, with no promises about implementation. I don\'t know about how libraries vary from platform to plaform, but assumi

9条回答
  •  遥遥无期
    2020-12-30 10:19

    A qsort implementation which can fail on large arrays is extremely broken. If you're really worried I'd go RTFS, but I suspect any half-decent implementation will either use an in-place sorting algorithm or use malloc for temporary space and fall back to an in-place algorithm if malloc fails.

提交回复
热议问题