Chapter 4 Flashcards
is the process of finding some particular element in the list.
Searching
also called as sequential search, is a very simple method used for searching an array for a particular value.
Linear search
is defined as asearching algorithmused in a sorted array byrepeatedly dividing the search interval in half.
Binary Search
follows divide and conquer approach in which, the list is divided into two halves and the item is compared with the middle element of the list.
Binary search
The time complexity of linear search
O(n)
The time complexity of binary search
O(log n)
It is also called sequential search
Linear search
It is also called half interval search
Binary search
Performs equality comparison
Linear search
Performs ordering comparison
Binary search