Description
Implement a breadth-first binary tree crawler (BinaryTreeBreadthFirstCrawler) and a binary tree breadth-first iterator (modify BinaryTreeIterator).
-
Start with depth-first crawler code from lecture 10 and depth—first iterator code from lecture 11. Modify copies of “binary_tree_depth_first_crawler.c” and “binary_tree_depth_first_crawler.h” to create breadth-first versions and modify for breadth-first traversal.
-
Modify “binary_tree_iterator.c” and “binary_tree_iterator.h” to add a new style “breadthFirst” and add breadth-first traversal style.
-
Modify a copy of ArrayDeque and ArrayList to use an array of void* pointers rather than an array of char*pointers. This will enable you to enqueue and dequeue BinaryTreeNode pointers.
-
Create a new “binary_tree_breadth_first_main.c” to test the functions. If CUnit is working on your computer, create unit tests similar to those in “binary_tree_iterator.c”. If is CUnit is not working on your computer, create tests similar to those in “binary_tree_depth_first_crawler.c”.