Simple Binary Tree:
In this blog we will see, how to create a simple binary tree. We will be using Queue data structure to store the last node inserted in the tree. This will prevent unnecessary traversal of tree for each new node insertion.
Time Complexity: O(n)
Space Complexity: O(n)
In this blog we will see, how to create a simple binary tree. We will be using Queue data structure to store the last node inserted in the tree. This will prevent unnecessary traversal of tree for each new node insertion.
Time Complexity: O(n)
Space Complexity: O(n)
No comments:
Post a Comment