POV-Ray : Newsgroups : povray.off-topic : 10 things to use a Min Heap for : Re: 10 things to use a Min Heap for Server Time
7 Sep 2024 21:16:58 EDT (-0400)
  Re: 10 things to use a Min Heap for  
From: Warp
Date: 20 Jun 2008 05:42:51
Message: <485b7b9b@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Well now, there's red-black trees, AVL trees, the BWS algorithm, 
> B-trees... exactly *which* self-balancing tree algorithm are we talking 
> about here?

  Does it matter?

  Btw, fun fact about balanced binary search trees: When traversing the
tree from the smallest element to the largest, the computational
complexity of one step (ie. moving from one element to the next larger
element) is O(log n). Oviously since you are traversing all the elements
in the tree, you are doing n such steps. Intuition would tell that the
computational complexity of the whole traversal would, thus, be O(n*log n).
However, it's only O(n).

  Proving this sounds difficult, but it's surprisingly simple.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.