Back to Browse

Learn Binary Search with Visualizer | JavaScript

1.4K views
Jul 27, 2022
13:26

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#mode=display Source code: https://github.com/ortoniKC/JS_DS_ALGO (https://www.geeksforgeeks.org/binary-search-in-javascript/#:~:text=Binary%20Search%20is%20a%20searching,O(N)%20time%20complexity.) Join this channel to get access to perks: https://www.youtube.com/channel/UCNcnqL0P17hISKlOxTjkJ0g/join --------------------------------------------------------------------- 😊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: https://www.facebook.com/groups/letcode 🐦Discord: https://discord.gg/Tvwac8HgQD 📸Instagram: https://www.instagram.com/letcode.in/ 🎓 LinkedIn: https://www.linkedin.com/in/ortoni/ ⛳️ XPath Extension: https://bit.ly/2T5EUCu Join our WhatsApp group (Only for Channel Members) http://bit.ly/3cSPCpm #letcode #javascript

Download

0 formats

No download links available.

Learn Binary Search with Visualizer | JavaScript | NatokHD