LWN.net Logo

Zeuthen: Writing a C library, part 1

Zeuthen: Writing a C library, part 1

Posted Jun 30, 2011 10:33 UTC (Thu) by MisterIO (guest, #36192)
In reply to: Zeuthen: Writing a C library, part 1 by njs
Parent article: Zeuthen: Writing a C library, part 1

>That deletes everything, needs no heap storage, and it's O(n (log n)^2), not so bad.
There's no point to this, a simple remove(value_at_root)(value at root simply because it's the simplest to find) for a balanced binary tree already takes O(log(n)), so why would I create a different algorithm to achieve the same performance?


(Log in to post comments)

Zeuthen: Writing a C library, part 1

Posted Jun 30, 2011 18:01 UTC (Thu) by njs (guest, #40338) [Link]

If your rebalancing algorithm doesn't require any heap allocations then right, there is no point.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds