1.

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

**Answer: Option 'A'**

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

2.

Can a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?

**Answer: Option 'B'**

**we need any two traversals for tree formation but if some additional stuff or techniques are used while storing a tree in an array then one traversal can facilitate like also storing null values of a node in array.**

3.

Disadvantage of using array representation for binary trees is?

**Answer: Option 'C'**

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

4.

Consider a situation of writing a binary tree into a file with memory storage efficiency in mind, is array representation of tree is good ?

**Answer: Option 'C'**

**In case of sparse trees(where one node per level in worst cases), the array size (2^h)-1 where h is height but only h indexes will be filled and (2^h)-1-h nodes will be left unused leading to space wastage which was actually main theme of question.**

5.

What must be the missing logic in place of missing lines for finding sum of nodes of binary tree in alternate levels?

//e.g:-consider -complete binary tree:-height-3, [1,2,3,4,5,6,7]-answer must be 23n=power(2,height)-1;//assume input is height and a[i] contains tree elementsfor(i=1;i<=n;) {for(j=1;j<=pow(2,currentlevel-1);j++)//present level is initialized to 1 and sum is initialized to 0{ sum=sum+a[i]; i=i+1; }//missing logic}

i=i+pow(2,currentlevel); currentlevel=currentlevel+2; j=1;

i=i+pow(2,currentlevel); currentlevel=currentlevel+2; j=0;

i=i-pow(2,currentlevel); currentlevel=currentlevel+2; j=1;

i=i+pow(2,currentlevel); currentlevel=currentlevel+1; j=1;

**Answer: Option 'A'**

**The i value must skip through all nodes in the next level and current level must be one+next level.**

6.

If the tree is not a complete binary tree then what changes can be made for easy access of children of a node in the array ?

**Answer: Option 'A'**

**Array cannot represent arbitrary shaped trees it can only be used in case of complete trees hence option a must be done which is one of several ways to use array in such situations.**

7.

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

**Answer: Option 'A'**

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

8.

Binary trees can have how many children?

**Answer: Option 'C'**

**0 or 1 or 2
Can have atmost 2 nodes.**

9.

Why is heap implemented using array representations than tree(linked list) representations though both tree representations and heaps have same complexities ?

Then why go with array representation when both are having same values ?forbinary heap -insert: O(log n) -delete min: O(log n)fora tree -insert: O(log n) -delete: O(log n)

**Answer: Option 'D'**

**In memory the pointer address for next node may not be adjacent or nearer to each other and also array have wonderful caching power from os and manipulating pointers is a overhead.**

- Array and Array Operations | Data Structure MCQs
- Stack Operations | Data Structure MCQs
- Queue Operations | Data Structure MCQs
- Singly Linked List Operations | Data Structure MCQs
- Doubly Linked List | Data Structure MCQs
- Circular Linked List | Data Structure MCQs
- Stack using Array | Data Structure MCQs
- Stack using Linked List | Data Structure MCQs
- Queue using Array | Data Structure MCQs
- Queue using Linked List | Data Structure MCQs
- Priority Queue | Data Structure MCQs
- Double Ended Queue (Dequeue) | Data Structure MCQs
- Stack using Queues | Data Structure MCQs
- Decimal to Binary using Stacks | Data Structure MCQs
- Towers of Hanoi | Data Structure MCQs
- Bit Array | Data Structure MCQs
- Dynamic Array | Data Structure MCQs
- Parallel Array | Data Structure MCQs
- Sparse Array | Data Structure MCQs
- Matrix | Data Structure MCQs
- Skip List | Data Structure MCQs
- Xor Linked List | Data Structure MCQs
- Free List | Data Structure MCQs
- Binary Trees using Array | Data Structure MCQs
- Binary Trees using Linked Lists | Data Structure MCQs
- Preorder Traversal | Data Structure MCQs
- Inorder Traversal | Data Structure MCQs
- Binary Tree Properties | Data Structure MCQs
- Binary Search Tree | Data Structure MCQs
- AVL Tree | Data Structure MCQs

- RRB NTPC and RRB Group D Free Model Papers in Tamil Telugu Hindi and English
- Current Affairs in Telugu - RRB NTPC and RRB Group D Model Papers in Telugu
- Arithmetic and Maths in Telugu MCQs - RRB NTPC and RRB Group D Model Papers in Telugu
- Biology MCQs - RRB NTPC and RRB Group D Model Papers in Telugu
- Reasoning Practice Tests in Telugu - RRB NTPC and RRB Group D Model Papers in Telugu
- Science and Technology MCQs - RRB NTPC and RRB Group D Model Papers in Telugu
- Chemistry MCQs in Telugu - RRB NTPC and RRB Group D Model Papers in Telugu
- Physics MCQs in Telugu - RRB NTPC and RRB Group D Model Papers in Telugu
- Indian Polity - Constitution & Administration in Telugu - RRB NTPC and RRB Group D Model Papers in Telugu
- Indian Geography in Telugu MCQs - RRB NTPC and RRB Group D Model Papers in Telugu
- Andhra Pradesh - Geography in Telugu - RRB NTPC and RRB Group D Model Papers in Telugu
- General Knowledge MCQs - RRB NTPC and RRB Group D Model Papers in Telugu
- General Studies in Telugu - APPSC TSPSC UPSC - MCQs
- Andhra Pradesh Economics Question and Answers - MCQs