Skip to content

Latest commit

 

History

History

0x1E-search_algorithms

What I learned from this project

At the end of this project you are expected to be able to explain to anyone, without the help of Google:

What is a search algorithm?
An algo that searches for a specific thing. Locates specific data in a collection. To retrieve info in a data structure.

What is a linear search?
Slow and O(n). You iterate through each data point, and making a comparison. The most basic go over all data sets brute force af.

What is a binary search?
Get a data set and search it like a binary tree. It will be O(log(n)).

What is the best search algorithm to use depending on your needs?
Depends on the size of the data set and the allowed allocated memory. Some algos are better than others for specific situations just like how some data structures are better than others because it always depends..

Each scripts and their output

  • Script 0 - Write a function that searches for a value in an array of integers using the Linear search algorithm.
  • Script 1 - Write a function that searches for a value in a sorted array of integers using the Binary search algorithm.
  • Script 100 - Write a function that searches for a value in a sorted array of integers using the Jump search algorithm.
  • Script 102 - Write a function that searches for a value in a sorted array of integers using the Interpolation search algorithm.
  • Script 103 - Write a function that searches for a value in a sorted array of integers using the Exponential search algorithm.
  • Script 104 - Script 1 but with recursion.