recategorized by
362 views
0 votes
0 votes

Worst Case scenario in case of linear search algorithm is_______________.

  1. Item is somewhere in the middle of the array
  2. Item is not in the array at all
  3. Item is the last element in the array 
  4. Item is the last element in the array or is not there at all 
recategorized by

1 Answer

2 votes
2 votes
Answer: D

In both the cases n comparison required(n is number of elements in array) which is the worst case. And time complexity O(n).

Related questions

1 votes
1 votes
0 answers
1
rsansiya111 asked Dec 6, 2021
392 views
If a hash table is implemented asa search tree, the expected time required to enter n names and make m searches is proportional to: (n + m) $log_{2} n$(n + m) $log_{2} m$...
0 votes
0 votes
1 answer
2
rsansiya111 asked Dec 6, 2021
708 views
Total number of nodes at the nth level of a full binary tree can be given as___________. 2n + 1$2n^{2}$2^n2n – 1
0 votes
0 votes
1 answer
3
rsansiya111 asked Dec 6, 2021
488 views
Which of the following is not a stable sorting algorithms ? Insertion sortSelection sort Bubble sortMerge sort
0 votes
0 votes
0 answers
4
rsansiya111 asked Dec 6, 2021
301 views
The time complexity of solving the Longest Common Subsequence problem using Dynamic Programming is: (m and n are lengths of subsequences) O(m.n)O(m+n)O(log m.n)O(m/n)