Binary Search is a searching technique which works on the Divide and Conquer approach. It is used to search for any element in a sorted array. Compared with linear, binary search is much faster with a Time Complexity of O(logN)
Steps:
BASE CONDITION: If starting index is greater than ending index return false.
Compute the middle index.
Compare the middle element with number x. If equal return true.
If greater, call the same function with ending index = middle-1 and repeat step 1.
If smaller, call the same function with starting index = middle+1 and repeat step 1.
Use the visualizer:
https://pythontutor.com/render.html#m...
Source code:
https://github.com/ortoniKC/JS_DS_ALGO
(https://www.geeksforgeeks.org/binary-...)
Join this channel to get access to perks:
/ @letcode
---------------------------------------------------------------------
😊Just in case you want to support me,
🎁https://www.buymeacoffee.com/letcode
-------------------------Thank you--------------------------
Thanks for watching, if you like the video, give it a thumbs up 👆.
Sharing is caring, kindly share the video with your friends and colleagues.
Don't forget to subscribe and hit the bell 🔔 notification.
-------------------------------SOCIAL-------------------------------
📝Test Practice Site: https://letcode.in/
👥Facebook Group: / letcode
🐦Discord: / discord
📸Instagram: / letcode.in
🎓 LinkedIn: / ortoni
⛳️ XPath Extension: https://bit.ly/2T5EUCu
Join our WhatsApp group (Only for Channel Members)
http://bit.ly/3cSPCpm
#letcode #javascript
Auf dieser Seite können Sie das Online-Video Learn Binary Search with Visualizer | JavaScript mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer LetCode with Koushik 27 July 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,407 Mal angesehen und es wurde von 26 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!