## Help authour, Buy PDF Ebook
>>>**Click Here**<<<

## Data Structure Questions and Answers-Binary Trees using Array

Question 1 |

Binary trees can have how many children?

2 | |

any number of children | |

0 or 1 or 2 | |

0 or 1 |

**Data interpretation (DI) Questions answers**

Question 1 Explanation:

Can have atmost 2 nodes.

Question 2 |

Disadvantage of using array representation for binary trees is?

difficulty in knowing children nodes of a node | |

difficult in finding the parent of a node | |

have to know the maximum number of nodes possible before creation of trees | |

difficult to implement |

**Reasoning Questions answers**

Question 2 Explanation:

The array is fixed size (may be dynamic array or static array) but size is fixed.

Question 3 |

What must be the ideal size of array if the height of tree is 'l'?

2 ^{l}-1 | |

l-1 | |

l | |

2l |

**Library science Questions answers**

Question 3 Explanation:

Since maximum elements in a tree (complete binary tree) of height l will be 2

^{l}-1 so a good array size must be that (since a binary tree node may not always have 2 children but for safety a is correct).

Question 4 |

What are the children for node 'w' of a complete-binary tree in an array representation?

2w and 2w+1 | |

2+w and 2-w | |

w+1/2 and w/2 | |

w-1/2 and w+1/2 |

**Aptitude test Questions answers**

Question 4 Explanation:

Since each node has 2 children and so counting from beginning, a particular node will have children as option a.

Question 5 |

What is the parent for a node 'w' of a complete binary tree in an array representation when w is not 0?

floor(w-1/2) | |

ceil(w-1/2) | |

w-1/2 | |

w/2 |

**Geography Questions answers**

Question 5 Explanation:

Floor of w-1/2 because we can't miss a node.

There are 5 questions to complete.