The objective of this assignment is to implement a Linear Search Algorithm and a Binary Search Algorithm.
- Linear search or sequential search is an algorithm that will traverse the whole data structure in order to search for an element. In this assignment, we will see a linear search algorithm over an array. (See Slides)
- Binary search is said to be a logarithmic search or half-interval search, which is a very efficient algorithm in order to search an element from a sorted collection. (See Slides)
Implement the Algorithms using Java Language and Display the total number of comparisons made by each searching Algorithm.
COURSE : CIS 202 / assignment 1 / al yamama university
linear search algorithm implementation:
Total number of comparisons: 8
binary search algorithm implementation:
Total number of comparisons: 4