Starting from:
$30

$24

Micro Assignment #2 (first one was a quiz) Solution

For this micro assignment, you must implement a binary search tree print function for a level order printout for the supplied BST class. Included with this file is a BST class that includes everything but the PrintLevelOrderHelper function implemented. The InOrder, PostOrder, and PreOrder functions are already done, but the LevelOrder one needs finishing. Note that LevelOrder uses a queue-based solution instead of the stack based ones we’ve seen before. Your solution MUST use the C++ STL queue class. The solution is easiest done with a loop instead of recursion.




The code must compile and run on the EECS servers using g++. As provided, it compiles and runs with text output describing the problem. That text should be replaced with the proper output just like the other tree printout functions.




Grading




Your submission will be graded based on the following:




[7] Your modifications cause no runtime issues and your PrintLevelOrder prints out the given tree in the proper order level order: 4 2 6 1 3 5 7 9 8



[3] Your modifications contain good style. For example,



You provide meaningful variable names



You provide sufficient and meaningful comments



Your code is well structured


More products