Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by ryanschaefer

2 years ago

Is there a way to keep a list with changing values sorted in real time in order to use a log n search algorithm?

2 comments

ryanschaefer

Reply

throw_pm23  2 years ago

Yes, a binary search tree that is dynamically balanced, for example red-black or avl.

andromeduck  2 years ago

It's log n either way.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities