This, week, we'll be looking at trees.
Here are the readings:
- How To Not Be Stumped By Trees
- Leaf It Up To Binary Trees
- Demystifying Depth-First Search
- Breaking Down Breadth-First Search
The coding exercise this week is to implement a binary tree, depth first search, and in order traversal. You'll need to:
- Fork this repo (if you need help, ask). This will help me easily see everyone's code
- Implement
insert
to add a number the binary tree in the correct position - Implement
depthFirstSearch
- Implement
inOrderTraversal
- For extra credit, implement
BinaryTree
as a generic, e. g.BinaryTree<Int> or BinaryTree<String>
While it is true that none of the test actually force you to create a real BinaryTree, please do :)