Data Structures and Algorithm Analysis Set 15

Data Structures and Algorithm Analysis

Questions 141 to 150



141.
Which of the following statements is true related to a B-tree?
(a)
All entries of a node are greater than or equal to the entries in the node's children
(b)
All leaves are at the different depths
(c)
All the leaf nodes appear at same level
(d)
All non-leaf nodes have the exact same number of children
(e)
All nodes contain the exact same number of entries.
142.
A simple graph has no loops. Which of the following forms another property of a simple graph?
(a)
Contain un-weighted edges
(b)
Undirected
(c)
Have at least one vertex
(d)
Have no multiple edges
(e)
Must be directed.
143.
Which of the following information is not saved in the activation record, when ever a function call is executed?
(a)
Static and dynamic address links
(b)
Current depth of recursion
(c)
Formal parameters
(d)
Location where the function should return when done
(e)
Local variables.
144.
Use the following code and the linked list pictured below to answer the questions 24 - 26.
First

code and the linked list picture

Then, First ànextànextàdata is
(a)
Null
(b)
Syntax Error
(c)
30
(d)
20
(e)
45.
145.
Pick the right option from the following:
I.     Firstànext == Temp1.
II.     Temp1ànextàdata == 60.
III.    Temp2ànext ànext == NULL.
(a)
Only (I) is TRUE
(b)
Only (II) is TRUE
(c)
Both (I) and (II) are TRUE
(d)
Both (I) and  (III) are TRUE
(e)
Both (II) and (III) are TRUE.
146.
Decide whether the syntax of each of the following statements is valid or invalid.
I.     Firstànext = Temp1ànext;
II.     First ànext = *( Temp2ànext);
III.    * First = Temp2;
(a)
Only (I) is valid
(b)
Only (II) is valid
(c)
Only (III) is valid
(d)
Both (I) and (III) are valid
(e)
Both (II) and (III) are valid.
147.
Which of the following is not possible as a balance factor of any node of an AVL tree?
I.     -2.
II.     ±1.
III.    0.
IV.   2.
(a)
Only (I) above
(b)
Only (II) above
(c)
Only (III) above
(d)
Both (I) and (IV) above
(e)
Both (III) and (IV) above.
148.
Which of the following statement(s) is/are TRUE in view of a multi-way search tree? If a node has
I.     4 sub trees it contains 3 keys.
II.     5 keys, it has 7 sub trees.
III.    6 sub trees, it contains 6 keys.
IV.   10 keys if it contains 11 children.
(a)
Only (I) above
(b)
Only (II) above
(c)
Only (III) above
(d)
Both (I) and (IV) above
(e)
Both (II) and (III) above.
149.
Identify the name of the sorting in which time is not proportional to n2.
(a)
Selection sort
(b)
Bubble sort
(c)
Qucik sort
(d)
Merge sort
(e)
Insertion sort.
150.
How many fields are required by a node to represent the polynomials in computer memory using linked list?
(a)
Two fields
(b)
Four fields
(c)
More than three fields
(d)
One is enough
(e)
Three fields.


Answers


141.
Answer : (c)
Reason:  All the leaf nodes appear at same level  is true related to a B-tree.
142.
Answer : (d)
Reason:  A simple graph has no loops. Other property is to have no multiple edges.
143.
Answer : (b)
Reason:  Current depth of recursion  is not saved in the activation record, when ever a function call is executed.
144.
Answer : (e)
Reason:  the following code and the linked list pictured
code and the linked list pictured
Then, First ànextànextàdata = 45

145.
Answer : (b)
Reason:  Firstànext == Temp1 and Temp2ànext ànext == NULL are true.
146.
Answer : (a)
Reason:  The syntax of Firstànext = Temp1ànext is valid.
147.
Answer : (e)
Reason:  -2 and 2 is not possible as a balance factor of any node of an AVL tree.
148.
Answer : (e)
Reason:  If a node has 4 sub trees it contains 3 keys and 10 keys if it contains 11 children. is TRUE in view of a multi-way search tree.
149.
Answer : (d)
Reason:  Merge Sort is a sort  in which time is not proportional to n2.
150.
Answer : (e)
Reason:  Three fields are required by a not to represent the polynomials in computer memory using linked list.


No comments :

What you think about these Questions and Answers ? Let me know in comments.

Post a Comment