Data Structure and Algorithm Analysis
Questions 71 to 80
71.

The
Following is a binary tree. Answer questions (11 – 13) considering the below
given tree.
The
Inorder traversal of the above tree is


72.

The
Preorder traversal for the tree in question 11 is


73.

The
Postorder traversal for the tree in question 11 is


74.

There are
four trees named A, B, C and D having 8, 15, 13, 14 nodes in them
respectively. Which of them could have formed a full binary tree?


75.

In the
given binary tree if the nodes are stored in an array, then where the node 4
can be stored?


76.

Of the
following tree structure, which is efficient, considering space and time
complexities?


77.

Consider
the following two statements and choose the correct option:
I. According to Access strategies Linked
List is a linear one.
II. According to Storage Linked List is a
Nonlinear one.


78.

Which of
the following are differences between structures and arrays?


79.

Which of
the following pairs of statements are identical?


80.

A
"stack" is also known as what?

Answers
71.

Answer : (b)
Reason : Because the rules for traversing the binary
tree in Inorder are:
i. Traverse the left sub tree in Inorder
ii. Traverse the root
iii. Traverse the right sub tree in Inorder


72.

Answer : (d)
Reason : Because the rules for traversing the binary
tree in Preorder are:
i. Traverse the root
ii. Traverse the left sub tree in Preorder
iii. Traverse
the right sub tree in Preorder


73.

Answer : (c)
Reason : Because the rules for traversing the binary
tree in Postorder are:
i. Traverse the left sub tree in Postorder
ii. Traverse the right sub tree in Postorder
iii. Traverse the root


74.

Answer : (b)
Reason : In general there are 2^{n}1 nodes in a full binary tree.
By the method of elimination: Full
binary trees contain odd number of nodes. So there cannot be full binary
trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete
binary tree but not a full binary tree. So the correct answer is 15.


75.

Answer : (a)
Reason : At location
6
where
LCn means Left Child of node ‘n’ and RCn means Right Child of node ‘n’. Top row represents the node
values and bottom row represents the positions.


76.

Answer : (b)
Reason : Complete Binary Tree.
By the method of elimination: Full binary tree loses its nature
when operations of insertions and deletions are done. For incomplete binary
trees, extra storage is required and overhead of NULL node checking takes
place. So complete binary tree is the better one since the property of
complete binary tree is maintained even after operations like additions and
deletions are done on it


77.

Answer : (c)
Reason : As the linked list nodes do not have any index and hence they must
be accessed in linear order always. Also they are stored in discrete
locations and not in contiguous memory locations.


78.

Answer : (d)
Reason : As this is the most suitable option when compared to the other
options. Also option c, e are wrong.


79.

Answer : (e)
Reason : As both the operators [à and (*). ] are used to access the members of the structure through
pointers. All the other options have the syntax errors.


80.

Answer : (c)
Reason : As the Stack behaves in Last In First Out manner.

Answers:
71.

Answer : (b)
Reason : Because the rules for traversing the binary
tree in Inorder are:
i. Traverse the left sub tree in Inorder
ii. Traverse the root
iii. Traverse the right sub tree in Inorder


72.

Answer : (d)
Reason : Because the rules for traversing the binary
tree in Preorder are:
i. Traverse the root
ii. Traverse the left sub tree in Preorder
iii. Traverse
the right sub tree in Preorder


73.

Answer : (c)
Reason : Because the rules for traversing the binary
tree in Postorder are:
i. Traverse the left sub tree in Postorder
ii. Traverse the right sub tree in Postorder
iii. Traverse the root


74.

Answer : (b)
Reason : In general there are 2^{n}1 nodes in a full binary tree.
By the method of elimination: Full
binary trees contain odd number of nodes. So there cannot be full binary
trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete
binary tree but not a full binary tree. So the correct answer is 15.


75.

Answer : (a)
Reason : At location
6
where
LCn means Left Child of node ‘n’ and RCn means Right Child of node ‘n’. Top row represents the node
values and bottom row represents the positions.


76.

Answer : (b)
Reason : Complete Binary Tree.
By the method of elimination: Full binary tree loses its nature
when operations of insertions and deletions are done. For incomplete binary
trees, extra storage is required and overhead of NULL node checking takes
place. So complete binary tree is the better one since the property of
complete binary tree is maintained even after operations like additions and
deletions are done on it


77.

Answer : (c)
Reason : As the linked list nodes do not have any index and hence they must
be accessed in linear order always. Also they are stored in discrete
locations and not in contiguous memory locations.


78.

Answer : (d)
Reason : As this is the most suitable option when compared to the other
options. Also option c, e are wrong.


79.

Answer : (e)
Reason : As both the operators [à and (*). ] are used to access the members of the structure through
pointers. All the other options have the syntax errors.


80.

Answer : (c)
Reason : As the Stack behaves in Last In First Out manner.

No comments :
Post a Comment