A tree is one of the widespread data structures in computer science and a natural way to model certain subject areas. Everyone will encounter trees as a data structure in one form or another, even if they're not into computers or programming in general. The most obvious example is a family tree, and if we're looking for something more up our street, a file tree.
HTML, JSON, XML, and many others have a tree-like structure. Comments and product catalogs on websites can also be tree-like. Any hierarchy is a tree by its definition.
There is one curious aspect associated with trees. The level of understanding of trees and the ability to work with them correlates with the developer's skills. If it's easy for a developer to work with trees, then they'll be able to understand code quite well. Otherwise, they'll have more difficulties with writing and analyzing code.
In this course, there'll be no new syntax or any programming elements that you haven't studied in Hexlet before this course. However, the topic of trees is more complicated than other topics due to the recursive nature of the trees themselves. We should switch our brains onto trees — this is most likely the most challenging part. It is something that you can't just learn by reading the theory. Only practice and experimenting can help with this.
We want to simplify the understanding and memorizing, so our recommendations are the same:
- Be sure to repeat all the code given in theory locally on your computer
- Don't forget to print as much as possible to help you debug
- Display all data changes while the code is running
In this short course, we'll dive into the topic of trees and learn how to work with them. What won't be in this course is algorithms in the same way as you might see at university. This course has completely different goals. It teaches working with recursive data structures through tree recursion.
Are there any more questions? Ask them in the Discussion section.
The Hexlet support team or other students will answer you.
For full access to the course you need a professional subscription.
A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.