Skip to content

pragya-chauhan/Algoexpert.io

Repository files navigation

Algoexpert.io

https://www.algoexpert.io/questions https://github.com/alqamahjsr/Algorithms/tree/master/algoexpert.io/python https://github.com/pinglu85/algoExpert

DAY 1

Greedy Algorithm

Search

  • Binary Search: low and high are indices and not elements in the array. to make the code easy and clean set these in the beginning and remember the mid calculation formula. you also dont need a for loop because the comparison is between mid and target value so need for arr[i]. But a while loop which run until low<= high which will also chop the lenght of the loop by half which is why the complexity is logn

Releases

No releases published

Packages

No packages published

Languages