Data Structure Quiz 9

To improve Knowledge in the field of Data Structures

19 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

When linear queue of size MAXQUEUE were implemented in C, underflow occurs at

  1. Front = 0
  2. Rear = -1
  3. Rear = Front
  4. Rear - Front + 1 = 0
Question 2 Multiple Choice (Single Answer)

Let the getnode function is called when a node is required for insertion in a linked list. The overflow occurs when

  1. available list is empty
  2. available list is full
  3. available list is half full
  4. none of these
Question 3 Multiple Choice (Single Answer)

When linear queue of size MAXQUEUE were implemented in C, overflow occurs at

  1. Front = MAXQUEUE
  2. Rear = MAXQUEUE -1
  3. Rear = Front
  4. Rear - Front + 1 = 0
Question 4 Multiple Choice (Single Answer)

In a circular queue of size MAXQUEUE, overflow occurs at

  1. before incrementing rear, rear = front
  2. after incrementing rear, rear = front
  3. before incrementing rear, rear = front +1
  4. after incrementing rear, rear = front +1
Question 5 Multiple Choice (Single Answer)

Which among the following is not the correct difference between array and linked lists?

  1. Insertion in array is costlier whereas linked list is cheaper.
  2. Deletion in array is costlier whereas linked list is cheaper.
  3. Traversal in array is costlier whereas linked list is cheaper.
  4. Linked list requires more memory than array.
Question 6 Multiple Choice (Single Answer)

Which among the following algorithms requires the reverse of input string before processing through stacks?

  1. Infix to postfix conversion
  2. Infix to prefix conversion
  3. Postfix evaluation
  4. Prefix evaluation
Question 7 Multiple Choice (Single Answer)

Let the binary heap has depth equal to d. What is the minimum number of nodes in the heap?

  1. 2d+1 -1
  2. 2d+1
  3. 2d
  4. 2d -1
Question 8 Multiple Choice (Single Answer)

The operation decrease-key(H,x,k) is an operation that decreases the key of node x by k (if k<key(x) ) in a binary heap. What is the maximum effort required for this operation?

  1. Equal to height of the tree
  2. Constant
  3. Number of nodes in the heap
  4. None of these
Question 9 Multiple Choice (Single Answer)

Let multipop (S, k) is an operation that removes k items form the stack S. In which of the following algorithms, does the multipop() function can be applied?

  1. Infix to postfix conversion
  2. Infix to prefix conversion
  3. Postfix evaluation
  4. None of these
Question 10 Multiple Choice (Single Answer)

A descending priority queue is implemented by using linked list. Which of the following operations is the cheapest?

  1. Traversal
  2. Insertion
  3. Search
  4. Delete-Max
Question 11 Multiple Choice (Single Answer)

An ascending priority queue is implemented by using linked list. Which of the following operations is the cheapest?

  1. Traversal
  2. Insertion
  3. Delete-min
  4. Search
Question 12 Multiple Choice (Single Answer)

What is the total number of possible binary search tree with keys 20, 25 and 5?

  1. 4
  2. 3
  3. 5
  4. 6
Question 13 Multiple Choice (Single Answer)

Let there be a stack of integer values. How many elements does the stack contain after following operations?
PUSH(S,1), PUSH(S,2), … , PUSH(S,10)
Multipop(S,5)
PUSH(S,11), PUSH(S,12), … , PUSH(S, 30)
Multipop(S,10)

  1. 20
  2. 30
  3. 10
  4. 15
Question 14 Multiple Choice (Single Answer)

Let the binary heap has depth equal to d. What is the minimum number of nodes in the heap?

  1. 2d+1 -1
  2. 2d+1
  3. 2d
  4. 2d -1
Question 15 Multiple Choice (Single Answer)

In a circular queue of size MAXQUEUE, overflow occurs at

  1. Before incrementing rear, rear = front
  2. After incrementing rear, rear = front
  3. Before incrementing rear, rear = front +1
  4. After incrementing rear, rear = front +1
Question 16 Multiple Choice (Single Answer)

Given a linear queu

Front Rear
1 2 3 4 5 6 7
A B C
After the following operations, what will be the positions of front and rear?
Insert(Q,D) Remove(Q) Insert(Q,E)
  1. Rear = 6, Front = 3
  2. Rear = 7, Front = 4
  3. Rear = 7, Front = 3
  4. None of these
Question 17 Multiple Choice (Single Answer)

Given a linear queu

Front Rear
1 2 3 4 5 6 7
A B C
After the following operations, what will be the positions of front and rear?
Insert(Q,D) Insert(Q,E) Remove() Insert(Q,F)
  1. Rear = 7, Front = 4
  2. Rear =7, Front = 3
  3. Rear = 8, Front = 3
  4. Queue overflows
Question 18 Multiple Choice (Single Answer)

Given a circular queu

Rear Front
1 2 3 4 5 6 7
A B C
After the following operations, what will be the positions of front and rear?
Insert(Q,X), Insert(Q,Y), Remove(Q), Insert(Q,Z) Insert(Q,D), Insert(Q,E)
  1. Rear =1, Front = 1
  2. Rear = 1, Front = 7
  3. Rear = 1, Front = 2
  4. Queue overflows
Question 19 Multiple Choice (Single Answer)

Given a circular queu

Rear Front
1 2 3 4 5 6 7
A B C
After the following operations, what will be the positions of front and rear?
Insert(Q,X), Insert(Q,Y), Remove(Q), Insert(Q,Z)
  1. Rear = 6, Front = 1
  2. Rear = 6, Front = 7
  3. Rear = 7, Front = 1
  4. None of these