Is this a complete binary tree or almost complete binary tree?? For node 25 there is no left child...

### 4 Comments

## 3 Answers

Best answer

### 6 Comments

@idontknowwho

This is not a min heap as the tree is not complete . 27 should be on left . Then the answer holds

This is not a min heap. Leaves should be filled from left to right. If 27 were a left child, then this tree would be min heap. Write this tree as an array and use formula (2i + 2) for 25’s right child index. You won’t get 27 as answer but this tree has 27 as right child. (Assuming indices start from 0 and i is 25’s index)

c.

let Node A has to b deleted.

1. Find deppest node as well as selection of deepest node which preserve structure..

2. overwrite A data with deepest node data.

3. delete deepest node.

b. finding deepest node is crucial here .. in this case 5 will be overwritten by 27.. then delete 27..

Complete Binary tree because

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.

reference - http://web.cecs.pdx.edu/~sheard/course/Cs163/Doc/FullvsComplete.html