Created
January 8, 2023 08:05
-
-
Save mjcarnaje/58829386e6edbce2970ae5be9a897ddb to your computer and use it in GitHub Desktop.
Binary Tree Output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the tree size is: 0 | |
inserting 1... | |
inserting 5... | |
inserting 2... | |
inserting 7... | |
inserting 4... | |
inserting 3... | |
inserting 5... | |
inserting 8... | |
inserting 9... | |
inserting 2... | |
inserting 10... | |
inserting 11... | |
inserting 3... | |
inserting 7... | |
inserting 9... | |
inserting 8... | |
inserting 4... | |
inserting 6... | |
inserting 1... | |
inserting 6... | |
the tree size is: 20 | |
displaying traversals... | |
Preorder traversal: 1 1 5 2 2 4 3 3 4 5 7 7 6 6 8 8 9 9 10 11 | |
Inorder traversal: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 11 | |
Postorder traversal: 1 2 3 4 3 5 4 2 6 6 7 8 9 11 10 9 8 7 5 1 | |
Levelorder traversal: 1 1 5 2 7 2 4 7 8 3 5 6 8 9 3 4 6 9 10 11 | |
removing 1... | |
removing 2... | |
removing 3... | |
removing 4... | |
removing 5... | |
the tree size is: 15 | |
displaying traversals... | |
Preorder traversal: 2 1 6 5 4 3 7 7 6 8 8 9 9 10 11 | |
Inorder traversal: 1 2 3 4 5 6 6 7 7 8 8 9 9 10 11 | |
Postorder traversal: 1 3 4 5 6 7 8 9 11 10 9 8 7 6 2 | |
Levelorder traversal: 2 1 6 5 7 4 7 8 3 6 8 9 9 10 11 | |
1 is in the tree... | |
2 is in the tree... | |
3 is in the tree... | |
4 is in the tree... | |
5 is in the tree... | |
emptying the tree... | |
the tree size is: 0 | |
displaying traversals of copy... | |
Preorder traversal: 1 1 5 2 2 4 3 3 4 5 7 7 6 6 8 8 9 9 10 11 | |
Inorder traversal: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 11 | |
Postorder traversal: 1 2 3 4 3 5 4 2 6 6 7 8 9 11 10 9 8 7 5 1 | |
Levelorder traversal: 1 1 5 2 7 2 4 7 8 3 5 6 8 9 3 4 6 9 10 11 | |
removed 1 from copy... | |
removed 2 from copy... | |
removed 2 from copy... | |
removed 3 from copy... | |
removed 3 from copy... | |
the copy tree size is: 15 | |
displaying traversals of copy... | |
Preorder traversal: 4 1 5 4 5 7 7 6 6 8 8 9 9 10 11 | |
Inorder traversal: 1 4 4 5 5 6 6 7 7 8 8 9 9 10 11 | |
Postorder traversal: 1 5 4 6 6 7 8 9 11 10 9 8 7 5 4 | |
Levelorder traversal: 4 1 5 4 7 5 7 8 6 8 9 6 9 10 11 | |
constructing a statically-allocated binary tree... | |
Preorder traversal: A B D C E G F H I | |
Inorder traversal: B D A G E C H F I | |
Postorder traversal: D B G E H I F C A | |
Levelorder traversal: A B C D E F G H I |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment