So this will pretty much wrap up our short expedition into binary trees. Remember that these functions rely on my earlier posts dealing with the class and nodes. The three types of traversals we will look at are: Preorder (root, left, right) Inorder (left, root, right) Postorder (left, right, root) Preorder Traversal This type of traversal can be used to […]
I found the basis of a print on Stackover flow the other day and changed it a little bit to be more compatible across compiler versions. Happy Coding! For some reason my code editor wouldn’t do the left slashes so below is a screenshot. Here is an example of what it will look like for the sequence 5 7 4 […]
Here is an example of a simple List class I wrote. Follow the comments to understand what is going on. This uses the node structure I wrote about here. Best of luck!