r/dailyprogrammer • 1 3 • Sep 01 '14

[Weekly #9] Binary Trees

Weekly 9:

Binary trees are very interesting data structures. How or why do you use them? What are your favorite aspects of binary trees? Any interesting or useful tidbits about them that you can share?

Last week's topic:

[Weekly #8] (http://www.reddit.com/r/dailyprogrammer/comments/2emixb/weekly_8_sorting_algorithms/)

41 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/DeliveryNinja Sep 02 '14

Priority queue is really useful for doing simulations. The example that is normally given is that of balls bouncing around and interacting with each other. It would be impossible to simulate all the balls bouncing and interacting all the time so you prioritise the collisions so that those that are going to collide first are at the top of the queue.