Data Structures and Algorithms - Sorting and Searching

1. The average search time of hashing, with linear probing, will be less if the load factor

Cancel reply

Your email address will not be published.


Cancel reply

Your email address will not be published.


2. The time complexity of the linear search algorithm over an array of n elements is

  • Option : B
  • Explanation : Linear search has linear-time complexity; binary search has log-time complexity. Here is a table that provides some intuition about the running speeds of algorithms Logarithmic: Linear: array size | N -------------------------------------------------------- 8 | 8 128 | 128 256 | 256 1000 | 1000 100,000 | 100,000 .... Binary search and other divide-and-conquer algorithms have logN time complexity; we say O(logN) Linear search has linear time complexity: O(N). So the option is 'B'
Cancel reply

Your email address will not be published.


Cancel reply

Your email address will not be published.


3. The time required to search an element in a linked list of length n is

Cancel reply

Your email address will not be published.


Cancel reply

Your email address will not be published.


4. The worst-case time required to search a given element in a sorted linked list of length n is

Cancel reply

Your email address will not be published.


Cancel reply

Your email address will not be published.


5. Which of the following sorting algorithms does not have a worst-case running time of O(n2)?

Cancel reply

Your email address will not be published.


Cancel reply

Your email address will not be published.