You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning! Here's your coding interview problem for today.
This problem was asked by Palantir.
You are given a list of N numbers, in which each number is located at most k places away from its sorted position. For example, if k = 1, a given element at index 4 might end up at indices 3, 4, or 5.
Come up with an algorithm that sorts this list in O(N log k) time.
The text was updated successfully, but these errors were encountered:
Good morning! Here's your coding interview problem for today.
This problem was asked by Palantir.
You are given a list of
N
numbers, in which each number is located at mostk
places away from its sorted position. For example, ifk = 1
, a given element at index4
might end up at indices3, 4, or 5
.Come up with an algorithm that sorts this list in
O(N log k)
time.The text was updated successfully, but these errors were encountered: