Explore topic-wise MCQs in Data Structure.

This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structure knowledge and support exam preparation. Choose a topic below to get started.

1.

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?

A. every node stores data saying which of its children exist in the array
B. no need of any changes continue with 2w and 2w+1, if node is at i
C. keep a seperate table telling children of a node
D. use another array parallel to the array with tree
Answer» B. no need of any changes continue with 2w and 2w+1, if node is at i
2.

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

A. floor(w-1/2)
B. ceil(w-1/2)
C. w-1/2
D. w/2
Answer» B. ceil(w-1/2)
3.

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

A. 2w and 2w+1
B. 2+w and 2-w
C. w+1/2 and w/2
D. w-1/2 and w+1/2
Answer» B. 2+w and 2-w
4.

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

A. 2<sup>l</sup>-1
B. l-1
C. l
D. 2l
Answer» B. l-1
5.

What is/are the disadvantages of implementing tree using normal arrays?

A. difficulty in knowing children nodes of a node
B. difficult in finding the parent of a node
C. have to know the maximum number of nodes possible before creation of trees
D. difficult to implement
Answer» D. difficult to implement
6.

How many children does a binary tree have?

A. 2
B. any number of children
C. 0 or 1 or 2
D. 0 or 1
Answer» D. 0 or 1