![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
DevMaster Editor
Join Date: Jan 2005
Posts: 54
|
Using Trees for Sorted Rendering
Author: Henry Yuen Description: This article discusses the idea of using Binary Search Trees (BSTs) to render objects in the desired order. |
|
|
|
|
|
#2 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
nice article, thanks for your contribution
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2003
Location: ON, Canada
Posts: 524
|
nicely written, Henry Yuen. Thank you
___________________________________________
"What ever happened to happily ever after?" |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2004
Posts: 9
|
Thanks a lot! Its my first tutorial...just trying to give back to the community that nourished me when i was a complete noob!
![]()
___________________________________________
http://hamath.blogspot.com - Science, Technology, Interesting Stuff Blog |
|
|
|
|
|
#5 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
cool, sounds like you got more in stock ?
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#6 |
|
Member
Join Date: Jul 2003
Posts: 97
|
why not use std::set? it's most often implemented as a RB-tree giving that it's mostly balanced.
|
|
|
|
|
|
#7 |
|
New Member
Join Date: Apr 2004
Posts: 9
|
I like to avoid STD containers, as:
1. I like to write things from scratch (yes, I know, I have the reinvent-the-wheel syndrome) 2. Overhead is slightly more than a bare bones tree. =).
___________________________________________
http://hamath.blogspot.com - Science, Technology, Interesting Stuff Blog |
|
|
|
|
|
#8 |
|
Member
Join Date: Jul 2003
Posts: 97
|
Well I can understand the will to write it yourself it's a great learning experience.
But wouldn't it at least be quite smart to spend the time to implement a selfbalancing tree like a RB-tree then? Plain old B-trees have a tendency to get awfully unbalanced and that degenerates their performance to in worst case linear complexity O(N). Also for locality of reference and other aspects I would consider taking a deeper look at your usage patterns, as describied in the article I think a heap would be a quite good match to. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|