Q. Binary search algorithm can not be applied to
In computer science, binary search is a type of method used for finding a certain element in a sorted list. It is an algorithm that is more efficient than linear search, which will go through every element in the list of items to find a particular element. However, the given list of elements must be sorted first before a binary search algorithm can be used.
The binary search algorithm works by repeatedly splitting the sorted list into two and working on the part of the list that may contain the element that you are looking for, until the final list contains only one element.
- sorted linked list
- sorted binary trees
- sorted linear array
- pointer array
Answer: sorted linked list
In computer science, binary search is a type of method used for finding a certain element in a sorted list. It is an algorithm that is more efficient than linear search, which will go through every element in the list of items to find a particular element. However, the given list of elements must be sorted first before a binary search algorithm can be used.
The binary search algorithm works by repeatedly splitting the sorted list into two and working on the part of the list that may contain the element that you are looking for, until the final list contains only one element.
No comments:
Post a Comment
What you have to say about this?