News for hackers. Stuff that matters.
Re:A curious case of O(N^2) behavior which should be O(N) (2... by Epa095 on Sunday December 22, 2024 @05:02AM (#42485439)
I got the impression that the expected performance of the double linked list insertion is actually O(1), since in most cases the elements arrive in sorted order. It's been a time since my algorithm courses, but I think all the 'normal' trees have log(n) insertion in that case.
Re:A curious case of O(N^2) behavior which should be O(N) (2... by nrdvana on Sunday December 22, 2024 @09:08AM (#42486404)
O(n) is generally indistinguishable from O(log n) so if there is any chance of different behavior than the expected optimum, go with the better algorithm.