Abhinaw TripathiJun 14, 20162 min readTree continue complete example in core-javaComplete Tree program: import java.util.Stack; /** * */ /** * @author Abhinaw.Tripathi * */ class Node { public int iData; ...
Abhinaw TripathiJun 2, 20162 min readBinary Tree to Binary Search Tree ConversionFollowing is a 3 step solution for converting Binary tree to Binary Search Tree. 1) Create a temp array arr[] that stores inorder...
Abhinaw TripathiJun 2, 20161 min readFind k-th smallest element in BST (Order Statistics in BST)Solution Approach: By using In order traversal of BST retrieves elements of tree in the sorted order. The in order traversal uses stack...
Abhinaw TripathiJun 2, 20161 min readHow to check if a Binary Tree is BST or not?What is Binary Search Tree(BST)? A binary search tree (BST) is a node based binary tree data structure. Must have these Properties: ...