Which of the following algorithms, implemented as in the text, runs in O(n) time the
presented with an array of n identical elements?
A -
All of the above
B -
Insertion sort
C -
Merge
D -
Quicksort
2-
Which one of the following applications would not be suitable to implement using a
Stack?
A -
A program to keep track of patients as they check into a hospital clinic, assigning each to a doctor on a first-come, first-served bases
B -
A program to solve a maze is to backtrack to an earlier position (the last place where a choice of direction taken was made) when a dead-end position is reached
C -
A program to receive a set of data that is to be saved and processed in the reverse order
D -
A program ro determine whether pairs of brakets in an arithmetic expression mathched
3-
Which of the following are Binary Search Trees:
A -
3, 4, 5
B -
4,, 2, 7
C -
1, 2, 8
D -
3, 4, 6
4-
Which of the following is true about the height of a node?
A -
The height of a leaf is 0
B -
All of the others answers are true
C -
The height of an empty tree is 0
D -
The height of a node is one less than the height of its parent
5-
Which traversal does not use a stack?
A -
Preorder
B -
All of these traversals uses a stack
C -
Posorder
D -
Level order
6-
Which of the following is true about the height of a node?
A -
All of the others answers are true
B -
The height of an empty tree is 0
C -
The height of a node is one less than the height of its parent
D -
The height of a leaf is 0
7-
____ is the way you groups things together by placing one thing on top of another and
then removing things one at a time from the top
A -
Pointer
B -
Array
C -
All of the above
D -
Stack
8-
Which of the following data structures requires more than constant average time for
insertions?
A -
Queue
B -
All of the others answers have constant time insertion algorithms
C -
Search tree
D -
Stack
9-
Which of the following statements is true about deleting the root of a binary search
tree?
A -
The root pointer changes if it does not have two children
B -
The root pointer always changes
C -
If the root has two children, its item is replaced by the largest element in the right subtree
D -
All of the others answers
10-
Why do built-in strings in C/C++ have the type char*?
A -
A string is a array of characters; tha char* variable holds the starting address of the array
B -
char* is a sprecial expression that is understood to mean "string"
C -
A strings chracters are accessed by changing the value in the char* variable to refer to different characters in the string