Data Structure Objective Type Questions And Answers

Data structure multiple choice questions and answers with explanation.
1) 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
Show/Hide Answer
Answer = A 
Explanation: No Explanation
2) The complexity of binary search algorithm is ?
  1. n
  2. nlogn
  3. logn
  4. n2
Show/Hide Answer
Answer = D 
3) The postfix equivalent of the prefix * + ab - cd is ?
  1. ab + cd - *
  2. abcd + - *
  3. ab + cd * -
  4. ab + - cd *
Show/Hide Answer
Answer = A
Explanation: No Explanation
4)The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is?
  1. Conceptually easier
  2. Completely dynamic 
  3. Efficient in accessing an entry
  4. Efficient if the sparse matrix is a band matrix
  5. A and B
Show/Hide Answer
Answer = E 
Explanation: N/A
5) Sparse matrix have ?
  1. many zero entries
  2. many non-zero entries
  3. higher dimension
  4. none of above
Show/Hide Answer
Answer = A 
Explanation: A sparse matrix is a matrix populated primarily with zeros
6) Which of the following algorithm solves the all pair shortest path problem ?
  1. Dijkstra's algorithm
  2. Floyd's algorithm
  3. Prim's algorithm
  4. Warshall's algorithm
Show/Hide Answer
Answer = B 
Explanation: The Floyd–Warshall algorithm (also known as Floyd's algorithm, Roy–Warshall algorithm, Roy–Floyd algorithm, or the WFI algorithm) is a graph analysis algorithm for finding shortest paths in a weighted graph (with positive or negative edge weights) and also for finding transitive closure of a relation R.

7) As part of maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be ?
  1. Bubble sort
  2. Insertion sort
  3. Selection sort
  4. Heap sort
Show/Hide Answer
Answer = B 

8) The way a card game player arranges his cards as he picks them  up one by one, is an example of ?
  1. bubble sort
  2. selection sort
  3. insertion sort
  4. merge sort
Show/Hide Answer
Answer = C 
Explanation: He scans throught the rest of the cards and pick the one with least value and places it next to the point till which he has already sorted the cards
9) The average successful search time for sequential search on 'n' items is ?
  1. n/2
  2. (n - 1)/2
  3. (n + 2)/2
  4. log(n) + 1
Show/Hide Answer
Answer = C 
10) Linked lists are suitable for which of the following problems ?
  1. Insertion sort
  2. Binary search
  3. Radix sort
  4. Polynomial manipulation
Show/Hide Answer
Answer = B 
Explanation: Through Linked list binary search can be performed efficiently.

Do You Like This? Please take 5 seconds to share with your firends.


Pardeep Singh said...

Ans for question 2 is wrong, its logn i.e. C. not D.

Anonymous said...

ya it is C for 2

Lauren Amick said...

I feel lucky to visit your site.
dissertation writing services

ajmath shaik said...

Excellent info ............
what is data structure and its types

Post a Comment