Saturday, 21 September 2013

Queues

1:
Which of the following is a collection of items into which items can be inserted arbitrarity and from which only the smallest item can be removed?
A.
Descending priority queue


B.
Ascending priority queue


C.
Fifo queue


D.
None of these



Answer & Explanation

Answer: Option B

Explanation :
2:
A________search begins the search with the element that is located in the middle of the array.
A.
Serial



B.
Random



C.
Parallel



D.
None of the above




Answer & Explanation

Answer: Option D

Explanation :

3:
A priority queue is used to implement a stack S that stores characters PUSH(C)is implemented as INSERT(Q,C,K)where K is an appropriate integer key chosen by the implementation.POP is implemented as DELETEMIN(Q).For a sequence of operations,the key chosen are in
A.
Non-increasing order


B.
Non-decreasing order


C.
Strictly increasing order


D.
Strictly decreasing order



Answer & Explanation

Answer: Option D

Explanation :

4:
Queues serve major role in
A.
Simulation of recursion


B.
Simulation of arbitrary linked list


C.
Simulation of limited resource allocation


D.
All of above



Answer & Explanation

Answer: Option C

Explanation :

5:
Which of the following data structure may give overflow error,even though the current number of element in it is less than its size?
A.
Simple queue


B.
Circular queue


C.
Priority Queues


D.
None of these



Answer & Explanation

Answer: Option A
6:
Number of "ADD" and "REMOVE" operations required to access n/2th elements of a queue of "n" elements so that the original queue remain the same after the access is (take help of another queue.)
A.
4*n


B.
8*n


C.
4*n-1


D.
8*n-1



Answer & Explanation

Answer: Option A

Explanation :

7:
The initial configuration of a queue is a, b, c, d, ('a' is in the front end). To get the configuration d, c, b, a, one needs a minimum of
A.
2 deletions and 3 additions



B.
3 deletion and 2 additions



C.
3 deletions and 3 additions



D.
3 deletions and 4 additions




Answer & Explanation

Answer: Option C

Explanation :

8:
Queue can be used to implement
A.
radix sort



B.
quick sort



C.
recursion



D.
depth first search




Answer & Explanation

Answer: Option A

Explanation :


No comments:

Post a Comment