DEV Community

Discussion on: Solution: Minimum Moves to Equal Array Elements II

Collapse
 
cristia45971976 profile image
Cristiano

Can we just find down the n/2-th greatest element in an array with O(n) time complexity by using quick select technique.

Collapse
 
seanpgallivan profile image
seanpgallivan

We could, indeed. It's significantly more code, but it would lower the time complexity.