1-
|
Which of the following traversals alway
|
|
A -
|
depends on how the elements are inserted
|
|
B -
|
Inorder
|
|
C -
|
Preorder
|
|
D -
|
Postorder
|
2-
|
Which of the following statements is not true?
|
|
A -
|
Singly linked liete can Increase their sizes faster than arraays can Increase their #
|
|
B -
|
The singly-linked list does not allow you to access the nth element in constant #
|
|
C -
|
You can search for and find a value in an array in constant time
|
|
D -
|
If you mistakingly mis-assign the head pointer to NULL, you will lose the entire #
|
3-
|
Which data structure is used by the compiler to implement recursion?
|
|
A -
|
search tree
|
|
B -
|
queue
|
|
C -
|
stack
|
|
D -
|
priority queue
|
4-
|
Which of the following is not #
|
|
A -
|
Tree: root: 4 children of 4: 3,5 children 3: 2,null children of 5: null,6
|
|
B -
|
Tree: root: 4 children of 5: null,6
|
|
C -
|
Tree: root: 4 children of 6: 4,9 children 9: 7,null
|
|
D -
|
Tree: root: 6 children of 6: 8,9 children 9: 7,null
|
5-
|
Which of the following statements will not affect the value of x?
|
|
A -
|
x = x++;
|
|
B -
|
x += x--;
|
|
C -
|
x++;
|
|
D -
|
x = --x + 1;
|
6-
|
Which of the following returns the object pointed to by an int pointer iptr?
|
|
A -
|
&iptr
|
|
B -
|
*iptr
|
|
C -
|
iptr
|
|
D -
|
reinterpret_cast(iptr)
|
7-
|
Which statement is correct?
|
|
A -
|
Once a tree is created, the root element cannot be deleted.
|
|
B -
|
An element can be inserted anywhere in a linked list
|
|
C -
|
An element can be inserted anywhere in a binary search #
|
|
D -
|
An element can be inserted anywhere in a stack
|
8-
|
Which one of the following lines of code has a run-tim error?
|
|
A -
|
int x = 1; int *p; p =* x;
|
|
B -
|
int x, *p = &x; *p = 1;
|
|
C -
|
int x = 1; int *p = &x;
|
|
D -
|
int x = 1; int *p; p = &x;
|
9-
|
Which of the following returns the memory address of an int object anInt?
|
|
A -
|
anInt
|
|
B -
|
*anInt
|
|
C -
|
&anInt
|
|
D -
|
addrof(anInt)
|
10-
|
Which of the following is referred to as a last-in, first-out (LIFO)?
|
|
A -
|
Linked List
|
|
B -
|
Queue
|
|
C -
|
Stack
|
|
D -
|
Tree
|