Blogs Hub

by AskGif | Aug 16, 2018 | Category :coding

Search an element in binary tree without recursion.

Search an element in binary tree without recursion.

We can use level order traversal for solving this problem. The only change required in level order traversal is, instead of printing the date we just need to check whether the root data is equal to the element we want to search. source: Data Structures and Algorithms Made Easy in Jav

read more...

by AskGif | Aug 16, 2018 | Category :coding

Find maximum element in binary tree without recursion.

Find maximum element in binary tree without recursion.

We could have used either PreOrder, InOrder or PostOrder traversal to find the maximum in a Tree but as it is mentioned that we need to find the maximum without using Recursion. Using Level Order Traversal we can find the Maximum element. We just need to observe the elements data while de

read more...

by AskGif | Aug 14, 2018 | Category :coding

How to implement Level Order Traversal in Binary Tree?

How to implement Level Order Traversal in Binary Tree?

Trees can also be traversed in level-order, where we visit every node on a level before going to a lower level. This search is referred to as a breadth-first search (BFS), as the search tree is broadened as much as possible on each depth before going to the next depth. Java implementation

read more...