Hacker News new | ask | show | jobs
by andromeduck 1037 days ago
O(log n) vs O(1)
1 comments

Is there a way to keep a list with changing values sorted in real time in order to use a log n search algorithm?
Yes, a binary search tree that is dynamically balanced, for example red-black or avl.
It's log n either way.