# Trees

Org charts, folders and web pages are trees: learn their parts, and the four ways to walk one, each the right order for a different job.

Updated: November 17, 2026

## [Trees](https://www.ask-codey.com/courses/data-structures/topics/ds-trees)

1. [Who Works Under Whom? Trees](https://www.ask-codey.com/lessons/ds-trees) (Apprentice): List everyone who works under a manager in a company of 10,000, without rereading every row for every person: why a list of rows and a name-to-manager dictionary fall short, and the structure that fixes them, the tree, with its words (root, parent, child, leaf, depth and height).
2. [Print the Chart, Count the Teams: Walking a Tree in the Right Order](https://www.ask-codey.com/lessons/ds-tree-traversals) (Journeyman): Show one org chart three ways (printed with each team indented, with each manager's head count, and one level at a time) by visiting every person in the order each job needs: the four traversals, and which job each one is for.

## [Exercise: The Company Org Chart](https://www.ask-codey.com/courses/data-structures/topics/exercise-ds-org-chart)

1. [Exercise: The Company Org Chart](https://www.ask-codey.com/lessons/exercise-ds-org-chart) (Journeyman): The staff app's org chart page needs a head count for any manager, the people at the bottom of the chart, and the whole chart printed with each team indented, each from one visit per person: build all three, and the tests check them.

Source: https://www.ask-codey.com/courses/data-structures/chapters/ds-trees
