Re: [algogeeks] complete binary tree

2010-06-30 Thread sharad kumar
@sharad :we need to check at each intermediate level there are 2^n nodes so do a bfs...also perfom the count of left subtree and right subtree where count(left subtree)>count(right subtree)) On Tue, Jun 29, 2010 at 11:34 PM, sharad kumar wrote: > A *complete binary tree* is a binary tree in w

Re: [algogeeks] complete binary tree

2010-06-30 Thread Raj N
Find the height of the tree. And start the traversal from root, if at any level < height, its left or right child is NULL then it is not complete binary On Tue, Jun 29, 2010 at 11:34 PM, sharad kumar wrote: > A *complete binary tree* is a binary tree in which every level, *except > possibly the l

[algogeeks] complete binary tree

2010-06-29 Thread sharad kumar
A *complete binary tree* is a binary tree in which every level, *except possibly the last*, is completely filled, and all nodes are as far left as possible write a code which check whether a given tree is complete or not -- You received this message because you are subscribed to the Google Groups