Tuesday, 22 December 2015

Data Structure for IBPS IT Officer Exam Quiz 122

Data Structure (DS) Questions and Answers for IBPS IT Officer Exam Professional Knowledge MCQs Quiz series.

Q.1. If the sequence of operations - push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop are performed on a stack, the sequence of popped out values are ?
  1. 2, 2, 1, 1, 2
  2. 2, 2, 1, 2, 2
  3. 2, 1, 2, 2, 1
  4. 2, 1, 2, 2, 2
Answer = A
Explanation:
The elements are popped from the top of the stack.
Q.2. Queue can be used to implement ?
  1. radix sort
  2. quick sort
  3. recursion
  4. depth first search
Answer = A 
Explanation:
A simple version of an LSD radix sort can be achieved using queues as buckets.
Q.3. A machine took 200 sec to sort 200 names, using bubble sort. In 800 sec, it can approximately sort ?
  1. 400 names
  2. 800 names
  3. 750 names
  4. 800 names
Answer = A
Explanation:
For sorting 200 names bubble sort makes 200 x 199/2 = 19900 comparisons. The time needed for 1 comparison is 200 sec. In 800 sec it can make 80,000 comparisons. We have to fine n, such that n(n - 1)/2 = 80,000. From this n is approximately 400.
Q.4. A machine needs a minimum of 100 sec to sort 1000 names by quick sort.The minimum time needed to sort 100 names will be approximately ?
  1. 50.2 sec
  2. 6.7 sec
  3. 72.7 sec
  4. 11.2 sec
Answer = B 
Explanation:
In the best case quick sort algorithm makes n log(n) comparisons. so 1000 x log (1000) = 9000 comparisons, which takes 100 sec. To sort 100 names a minimum of 100 log(100) = 600 comparisons are needed. This takes 100 x 600/9000 = 6.7 sec.
Q.5. The number of binary trees with 3 nodes which when traversed in post order gives the sequence A,B,C is ?
  1. 3
  2. 9
  3. 7
  4. 5
Answer =  D
Explanation: Five trees are


Q.6. The average search time of hashing with linear probing will be less if the load factor ?
  1. is far less than one
  2. equals one
  3. is far greater than one
  4. none of above
Answer = A
Explanation:
Load factor is the ratio number of records that are currently present and the total number of records that can be present. If the load factor is less, free space will be more. This means probability of collision is less. So the search time will be less. 
Q.7.  A binary tree that has n leaf nodes. The number of nodes of degree 2 in this tree is ?
  1. log2n
  2. n - 1
  3. n
  4. 2n
Answer = B
Explanation:
It can be proved by induction that a binary tree with n leaf nodes will have total of 2n - 1 nodes. So number of non-leaf nodes is (2n - 1)-n=n-1
Q.8. The principal of locality justifies the use of ?
  1. Interrupts
  2. DMA
  3. Polling
  4. Cache memory
Answer = D
Explanation:
In principal of phenomenon the same value or same memory location is being used frequently. 
Q.9. Sparse matrices have ?
  1. many zero entries
  2. many non- zero entries
  3. higher dimension
  4. none of above
Answer = A Explanation: A sparse matrix is a matrix populated primarily with zeros
Q.10. The postfix expression for * + a b - c d is?
  1. ab + cd - *
  2. ab cd + - *
  3. ab + cd * -
  4. ab + - cd *
Answer = A
Explanation:
No Explanation 

Also read :

Algorithms for Dummies (Part 1): Big-O Notation and Sorting

No comments:

Post a Comment

Advertisement