Final Remarks
Here’s a quick summary of what we learned from the “Trees” module.
We'll cover the following
Congratulations! You have successfully completed the “Trees” module.
Summary#
The tree data structure is widely used to organize and store hierarchical data in many domains—document object models (DOMs), natural language processing, compiler design, operating systems, route-finding, and maze-solving. In this module, we learned to choose the appropriate tree for a given problem. We also reviewed both major tree traversal techniques. In depth-first search, we traverse the entire left subtree at each level before backtracking and then traversing the right subtree. In breadth-first search, we first visit all the nodes at a given level, and then move to the next level, and so on. We learned the specific strengths of each traversal technique and learned to choose the one that yields the most efficient solution for a given problem.
Additional resources#
If you’re looking for more challenges to solve using the patterns in this module, you can hone your skills on these problems:
Pattern Name | Problem Name |
Tree Depth-first Search | |
Tree Depth-first Search | |
Tree Depth-first Search | |
Tree Breadth-first Search | |
Tree Breadth-first Search | |
Tree Breadth-first Search | |
Tree Breadth-first Search |
What’s next?#
Now that we have learned how to use the appropriate traversal technique to solve problems featuring trees, we will dive into the use of hash maps and other techniques to track the key features of the input data that enable efficient solutions to hard problems, and cover two critical problem-solving patterns based on the heap data structure, in the next module, “Heaps, Hashing and Tracking.”
Solution: Word Ladder
Heaps, Hashing and Tracking