retagged by
395 views
0 votes
0 votes

An unordered list contains $n$ distinct elements. The number of comparisons to find an element in the list that is larger than the second minimum in the list is

  1. $\Theta(n \log n)$
  2. $\Theta(n/ \log n)$
  3. $\Theta(1)$
  4. $\Theta(\log n)$
retagged by

1 Answer

1 votes
1 votes
I think just 3 comparisons are needed among 1st, 3 elements of the array. the elements greater in this 1st, 3 elements will definitely be greater than the 2nd minimum element.

Hence T(n)  = O(1)
Answer:

Related questions

0 votes
0 votes
1 answer
1
admin asked Jan 5, 2019
454 views
Which of the given options provides the increasing order of asymptotic complexity of functions $\text{f}_{1}, \text{f}_{2}, \text{f}_{3}$ and $ \text{f}_{4} $ ?$\text{f}_...
0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
admin asked Jan 5, 2019
295 views
The recurrence equation $T(n) = T(\sqrt{n}) + O(1)$ has the following asymptotic solution:$T(n) = O(\sqrt{n})$$T(n) = O(\log n)$$T(n) = O(n^{1/\log n})$$T(n) = O(\log \lo...
0 votes
0 votes
0 answers
4
admin asked Jan 5, 2019
217 views
The Adjacency matrix of a directed graph $\text{G}$ is given below.$\begin{array} {} & a & b & c & d & e & f & g & h & i \\ a & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ b & ...