**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 ?**

- is far less than one
- equals one
- is far greater than one
- None of above

Show/Hide Answer

**Answer = A**

**Explanation:**No Explanation

**2) The complexity of binary search algorithm is ?**

- n
- nlog
_{n} - log
_{n} - n
^{2}

Show/Hide Answer

**Answer = D**

**Explanation:**N/A

**3) The postfix equivalent of the prefix * + ab - cd is ?**

- ab + cd - *
- abcd + - *
- ab + cd * -
- 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?**

- Conceptually easier
- Completely dynamic
- Efficient in accessing an entry
- Efficient if the sparse matrix is a band matrix
- A and B

Show/Hide Answer

**Answer = E**

**Explanation: N/A**

**5) Sparse matrix have ?**

- many zero entries
- many non-zero entries
- higher dimension
- 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 ?**

- Dijkstra's algorithm
- Floyd's algorithm
- Prim's algorithm
- 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 ?**

- Bubble sort
- Insertion sort
- Selection sort
- Heap sort

Show/Hide Answer

**Answer = B**

**Explanation:**N/A

**8) The way a card game player arranges his cards as he picks them up one by one, is an example of ?**

- bubble sort
- selection sort
- insertion sort
- 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 ?**

- n/2
- (n - 1)/2
- (n + 2)/2
- log(n) + 1

Show/Hide Answer

**Answer = C**

**Explanation:**N/A

**10) Linked lists are suitable for which of the following problems ?**

- Insertion sort
- Binary search
- Radix sort
- 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.

## 0 comments:

## Post a Comment