The Joy of Computing using Python Week 5: Assignment 1 | NPTEL | [Jan 2023]
The Joy of Computing using Python Week 5: Assignment 1 | NPTEL | [Jan 2023]
The Joy of Computing using Python Week 5 — Assignment 5 | NPTEL | Answer with Explanation

“Discover the Excitement of Computing with Python | Week 5 Multiple Choice Questions — Get ready to enhance your programming skills and deepen your understanding of the Python language with this week 5 MCQ on ‘The Joy of Computing using Python’. Test your knowledge and boost your confidence as a Python programmer today!”
Binary search can be applied on ___.
a. Sorted list
b. Unsorted list
c. Both A and B
d. Any list with any elementsAnswer
a. Sorted list
- Binary search is applied only on the sorted list it can not apply to an unsorted list.
- It is an efficient algorithm for searching for a specific element in a sorted list by repeatedly dividing the search interval in half until the element is found or determined to be not in the list.
- If the list is unsorted, binary search cannot be applied, as the algorithm relies on the fact that the list is already sorted to divide the search interval in half.
- For an unsorted list, a different search algorithm like linear search is typically used.