Trees are a commonly used data structure in computer science. A tree is a nonlinear data structure that is used to store data in a hierarchical manner. McMillan, Michael. Data Structures and Algorithms with JavaScript: Bringing classic computing approaches to the Web . O'Reilly Media. Kindle Edition.