AVL Trees – Real World Applications of AVL Trees

algorithmsdata structures

in school we are taught how we can balance an AVL tree upon an insertion or deleting.

How is this type of knowledge actually going to be useful in the real world?
Can someone give an example on when this type of knowledge would actually be useful?

From what I have seen, in the workplace such details hardly ever come up…

I can see how detailed knowledge about algorithms and some data structures can be important but not such details as AVL tree rotations (and similar detailed concepts).

thanks!

Best Answer

The study of AVL trees can be helpful for the following reasons:

  • It's great practice for reasoning about abstract data. You don't have to think about one particular tree, you have to consider every possibility. Practice with this kind of reasoning can help with simpler cases too.

  • It's great practice for understanding predicates and contracts. Ensuring that a tree is balanced, and the tools you use to prove each operation preserved balance, can, e.g., be applied to security concerns and to parallel code.

  • It empowers you to write your own variants, or to even create wholly new types of data structures.

  • You just may well have to implement an AVL tree for a new library or platform.

You can debate the particular merits of learning each kind of sorting algorithm or each kind of balanced tree. It doesn't really matter which ones you end up learning, but you should be sure to get full coverage of the most important topics.

If you want to see how important knowing algorithms is in the real world, read "How to Kill a Great Idea!", an article in Inc about Friendster's downfall, and how the slightest application of fundamental principles to improve efficiency could have helped them.

Related Topic