Is it possible to rearrange an array in place in O(N)?

后端 未结 9 1233
既然无缘
既然无缘 2020-12-24 14:17

If I have a size N array of objects, and I have an array of unique numbers in the range 1...N, is there any algorithm to rearrange the object array in-place in the or

9条回答
  •  余生分开走
    2020-12-24 14:58

    There's a histogram sort, though the running time is given as a bit higher than O(N) (N log log n).

提交回复
热议问题