Posts

Almost complete binary tree

 Almost Complete Binary Tree Almost complete binary tree is a binary tree which satisfies following conditions: Insertion of nodes must takes place level by level and all the nodes must be left justified(i.e. from left to right). All the levels from 1 to n-1 level(n stands for number of levels) should be completely filled without any gap. Important point is that if a node at level h (where h = 1 to n) has a right child, then it also has a left child. AT2 Here, ACBT stands for almost complete binary tree. In the above trees, left tree is a correct example of almost complete binary tree and right tree is an in-correct example of almost complete binary tree because at the last level, node left to node'F' is missing but according to the conditions of almost complete binary tree all nodes must be left justified. Almost complete binary tree is a complete binary tree till n-1 level. Almost complete binary tree is the subset of Complete binary tree(CBT), mean an almost complete binary ...