Summary

In this chapter, we covered the algorithms to add, search, and remove keys from a binary search tree, which is the basic tree data structure largely used in computer science. We covered three traversal approaches to visit all the nodes of a tree. We also learned how to create self-balanced trees using the AVL tree and insert and remove keys to/from it, and we also covered the Red-Black tree.

In the next chapter, we will learn about a special data structure called heap (or priority queue).

Get Learning JavaScript Data Structures and Algorithms - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.