Back to Data Structures & Algorithms

Trees

Introducing the non-linear tree data structure, including binary trees, traversals, and key properties.

1 week

Topics in this Chapter

1

Binary Tree

Defining the structure of a binary tree and its basic terminology (root, leaf, parent, child).

2

Traversal: Inorder, Preorder, Postorder (DFS)

Implementing the three fundamental depth-first traversal methods for binary trees.

3

Traversal: BFS (Level Order)

Implementing breadth-first or level-order traversal using a queue.

4

Diameter & Height

Calculating key properties of a binary tree like its height and diameter.

5

Serialization

Converting a binary tree to a string (serialize) and back (deserialize).

GeekDost - Roadmaps & Snippets for Developers