Closed XieGuochao closed 5 months ago
Hi, I find there is much space to improve the performance of ArrayMode.
If the element is comparable, I propose the following algorithm:
The original complexity is O(N^2) while the new one is O(N log N) with O(1) space complexity.
Can you assign this to me and I will try to implement it?
If we cannot modify the array, need O(N) additional space and this algorithm has no advantage.
Hi, I find there is much space to improve the performance of ArrayMode.
If the element is comparable, I propose the following algorithm:
The original complexity is O(N^2) while the new one is O(N log N) with O(1) space complexity.
Can you assign this to me and I will try to implement it?