Skip to content

Latest commit

 

History

History

searching_algorithms_exercise

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Searching Algorithms Exercise

For this exercise you must get the tests to pass.

linearSearch

This function should accept an array and value and return the index at which the value exists or -1 if the value can not be found. Do not use indexOf to solve this! This function should use iteration not recursion.

linearSearchRecursive

If you have not yet implemented this (it is a bonus in the recursion exercise). This function should accept an array and value and return the index at which the value exists or -1 if the value can not be found. Do not use indexOf to solve this! This function should use recursion.

binarySearch

This function should accept an array and value and return the index at which the value exists or -1 if the value can not be found. Do not use indexOf to solve this! This function should use iteration not recursion. Make sure that your algorithm runs in O(log(n)) and not O(n).

binarySearchRecursive

If you have not yet implemented this (it is a bonus in the recursion exercise). This function should accept an array and value and return the index at which the value exists or -1 if the value can not be found. Do not use indexOf to solve this! This function should use recursion. Make sure that your algorithm runs in O(log(n)) and not O(n).