Searching Algorithms

Learn how to perform a linear and binary search in Java.

We'll cover the following

Overview

One of the main advantages a computer offers is storing large amounts of data. Computers can find things quicker than humans. This capability is called searching. There are two main types of searching techniques:

  • Sequential search
  • Binary search

Sequential search

Going through all items, one by one, until we find the desired item is called a sequential search. It is also known as a linear search.

For example, if we have the following array, and we need to find 55, we’ll check all the elements one by one.

Get hands-on with 1200+ tech skills courses.