The recurrence relation for binary search algorithm is : 

This question was previously asked in
NIELIT Scientific Assistant CS 5 Dec 2021 Official Paper
View all NIELIT Scientific Assistant Papers >
  1. T(n) = 2T(n/2) O (1) 
  2. T(n) = 2T(n/2) O (n)
  3. T(n) = T(n/2) O (1) 
  4. T(n) = T(n/2) O (n)

Answer (Detailed Solution Below)

Option 3 : T(n) = T(n/2) O (1) 
Free
NIELIT Scientific Assistant Quantitative Aptitude Mock Test
0.5 K Users
20 Questions 20 Marks 30 Mins

Detailed Solution

Download Solution PDF

The correct answer is T(n) = T(n/2) O (1).

key-point-image Key Points

  • The binary search algorithm is a search algorithm that finds the position of a target value within a sorted array.
  • Binary search works by repeatedly dividing the search interval in half.
  • If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half.
  • Otherwise, narrow it to the upper half. Repeat until the value is found or the interval is empty.

additional-information-image Additional Information

  • The recurrence relation for the binary search algorithm is T(n) = T(n/2) + O(1).
  • This is because at each step, the algorithm divides the problem size by 2 (hence T(n/2)) and performs a constant amount of work (O(1)).
  • The time complexity of binary search is O(log n) in the worst case.
  • Binary search is more efficient than linear search, especially for large datasets.
Latest NIELIT Scientific Assistant Updates

Last updated on Feb 20, 2025

-> A total number of 113 revised vacancies have been announced for the post of Scientific Assistant in Computer Science (CS), Information Technology (IT), and Electronics & Communication (EC) streams.

-> Online application form, last date has been extended up to from 17th April 2025.

->The NIELT has revised the Essential Qualifications for the post of Scientific Assistant. Candidates must possess (M.Sc.)/ (MS)/ (MCA) / (B.E.)/ (B.Tech) in relevant disciplines.

 

-> The NIELIT Scientific Assistant 2025 Notification has been released by the National Institute of Electronics and Information Technology (NIELIT).

More Searching Questions

Get Free Access Now
Hot Links: teen patti 50 bonus teen patti master list teen patti 51 bonus