Вы находитесь на странице: 1из 5

Online Quiz

20:07

Q.No Question
1
The minimum number of fields in a node of doubly linked list :
1
2
3
4
2
What is the running time of the recursivearraymax algorithm finding the largest
element in an array?

Linear
Quadratic
Cubic
Logarithmic
3
In binary search the location of key is greater than the mid then

low = mid + 1
high = mid - 1
low = mid - 1
high = mid + 1
4
In a circular queue, for enqueue operation

rear=(rear+1)%QUEUE_SIZE
front=(front+1)%QUEUE_SIZE
front=(rear+1)%QUEUE_SIZE
rear=(rear-1)%QUEUE_SIZE
5
If a circular queue is maintained in an array A [ 0 .... n -1 ] and F and R indicate the
front and rear indices, the size of the queue is given by

R - F
R - F + 1
R - F + 1 ( mod n + 1 )
R - F + 1 ( mod n )
6
Direct or random access of element is not possible in :

Linked List
Array
String
None
7
for depth first search we use

stack
queue
tree
table
8
Suppose we have a circular array implementation of the queue class, with ten items
in the queue stored at data[2] through data[11]. The capacity is 42. Where does the
push member function place the new entry in the array?

data[2]
data [10]
data[11]
data[12]
9
In Linked lists as compared to Arrays

Insertions / Deletions are faster, but searching is slower
Searching is faster, but insertions / deletions are slower
Insertion / Deletions are performed at comparable speed, but searching is slower
Searching is performed at comparable speed, but insertion / deletions is slower
10
Recursive factorial algorithm is not good compared to iterative Factorial because of

Space complexity
Time complexity
Amortized complexity
Logarithmic complexity
11
Which condition in binary search tells that search list is empty :

low > high
low = = high
low < = high
low < high
12
What is the running time of a program to determine if a positive integer, N, is prime.

Linear
Quadratic
Cubic
Logarithmic
13
Observe the following code m = stack(); m.push('X') m.push('Y') m.pop() m.push('Z')
m.peek() What is the top element of the stack when the code completes its execution

Y
Z
X
Stack is Empty
14
Consider the following algorithm for searching for a given number x in an unsorted
array A [ 1...n ] having n distinct values : I. Choose an i uniformly at random from 1..n
; II. If A[i] = x then stop else Goto I ; Assuming that x is present in A, what is the
expected number of comparisons made by the algorithm before it terminates ?

n
n-1
2n
n/2
15
What is the running time of a statement inside a group of three nested loops?

Linear
Quadratic
Cubic
Logarithmic
16
the time factor when determining the efficiency of algorithm is measured by

counting microseconds
counting the number of key operations
counting the number of statements
counting the kilobytes of algorithm
17
The following post fix expression with single digit operands is evaluated using a stack
8 2 3 ^ / 2 3 * + 5 1 * - (where ^ is power operator) The top two elements of the stack
after the first * is evaluated are:

6,1
5,7
3,2
1,5
18
Searching a Linked List requires Linked List be created :

In sorted order only
In any order
Without underflow condition
None
19
Which among the following data structure may give overflow error, even though the
current number of elements in it, is less than its size :

Queue
Circular Queue
Stack
Dequeue
20
Here is an infix expression : 4 + 3 * ( 6 * 3 - 12). Suppose that we are using the usual
stack algorithm to convert the expression from infix to postfix notation. What is the
maximum number of symbols that will appear on the stack at one time during the
conversion of this expression ?

2
4
6
8

Вам также может понравиться