If you’re already familiar with binary search, I’d recommend the practice problem I introduced at 12:17. It’s a nice problem from my business affiliate algoexpert.io/csdojo - from which you can get a discount with my referral code csdojo.
@Ali-mc4le4 жыл бұрын
What is the blackboard app or tool you are using to show code examples? Looks great! I just joined algoexpert because of you :)
@htol784 жыл бұрын
+1 what software do you use to create presentation? looks pretty good.
@bhagwandas3214 жыл бұрын
Hello dojo thank you
@ahammedafzal77974 жыл бұрын
def search(arr, target): l = 0 r = len(arr)-1 while l arr[r] and target < arr[m]: r = m-1 else: l = m+1 return -1 right?
@tylerdurden41694 жыл бұрын
Continue this series of data structures.
@nx82214 жыл бұрын
would be great!
@lakshkaushik63664 жыл бұрын
Check out apni kaksha for ds and algo
@acm18124 жыл бұрын
@@lakshkaushik6366 no
@adibattie96193 жыл бұрын
It's not obvious how much binary search helps until you actually code it and time it yourself. It's actually amazing. Thanks for the informative videos!
@manuelelkess82594 жыл бұрын
This course of data structures and algorithms one of the best on the internet I really hope you continue it to the very end.
@ctcrnitv4 жыл бұрын
You are such a good teacher. I already knew what binary search was but this was brilliantly explained, probably the clearest explanation I've ever seen.
@prernacore4 жыл бұрын
please continue this course. it's the best that I have ever stumbled upon. Been watching all the videos since morning and I am so grateful for these , cleared all the doubts and making basics easier and clear. Thank you!
@TheNaderpop4 жыл бұрын
Man, how do I love your introduction to this series so much , I hope you finish this series as soon as possible.
@shokhrukhbekyursunjonov62034 жыл бұрын
That's so cool, learned a lot. I, myself, for example solved it like following: def search(arr,target): if target in arr: for i in arr: if arr[i]==target: return i print(search([1,2,3,11],11)) output: 3
@asdfractal81154 жыл бұрын
The way you explain the process of thinking about the problem is really good. While you are explaining the problem I can already imagine the code required to solve it. Your videos have helped me a lot to conceptualize solutions to my problems.. so thank you very much!
@dreamofmirrorsguy70432 жыл бұрын
You are insanely the best pragmatic youtuber and teacher I've watched so far. Thank you very much for your content!
@samuraijack59194 жыл бұрын
I'm not gonna lie, it is still hard to wrap my head around some of this stuff like time complexity and Big O. Thank you for all that you do!
@sashamuller97434 жыл бұрын
same bro same
@Veigaburame4 жыл бұрын
the way you seperate exercise into 10-15 minutes is pretty handy. I could spend time watching your video while having lunch. Love to see these kind of videos uploaded on KZbin. Thanks Dojo hehee
@dailycodingproblem83464 жыл бұрын
I’m 4 days away from turning 93 and CS Dojo inspired me to create my own tutorials. Thanks, CS Dojo!
@stevepriest51134 жыл бұрын
Happy birthday
@shubhamiot3264 жыл бұрын
@@stevepriest5113 I advance
@Name-mi7bx4 жыл бұрын
Fake, not the first time a simp Commented the same shit.
@Importunity4 жыл бұрын
you did not sound like you were turning 93 in your video bruh
@DjLeonSKennedy4 жыл бұрын
5 years i couldn't understand about complexity until now! thanks
@cpbeatzx2263 Жыл бұрын
This is no joke one of the best videos ive watched, I do not comment on youtube videos, but this deserves one. Thank you
@tylerxiao26564 жыл бұрын
My idea for shifted binary search: Copy the array once, so that an array like [3,1,2] becomes [3,1,2,3,1,2]. Next, we compute the maximum and minimum values of our original array, which are 3 and 1, respectively. Then, we run 2 pointers to find the indices of the range between the minimum and maximum, which in our example the indices are 1 and 3, and we binary search through those values.
@tylerxiao26564 жыл бұрын
Never mind, I watched the Errichto video on this. Rip I got this wrong
@rajibdpi4 жыл бұрын
Thank you so much for this great opportunity to Learn Dara structures and Algorithm with you.
@williambasquez76074 жыл бұрын
Back at it again with the good stuff 👨🏻💻💻
@mansmor72112 жыл бұрын
I can't not to like your videos, using technology and explaining in a simplest way makes it easy to understand even very difficult subjects.
@huckleberryfinn8795 Жыл бұрын
The best programming lessons on KZbin!!
@rakotonirinaolvanotjeancla19904 жыл бұрын
i am very very very happy to see you again. you are the best for explaination
@kuberchaurasiya4 жыл бұрын
Thanks. The sorted rotated array problem is very interesting
@SarangDhanurdhari4 жыл бұрын
Thanks a lot dojo. Please keep continuing this series.
@mattoattacko4 жыл бұрын
Heck yeah! You totally came through. Much appreciated mate!
@nagendradevara13 жыл бұрын
I have tried the python example in JavaScript function binarySearch(arr, target) { let left = 0; let right = arr.length - 1; arr = arr.sort((a, b) => a - b) while (left
@neevetiasli11 ай бұрын
For the first time ever i really understood
@lucyledezma7094 жыл бұрын
Hello CS Dojo!!!. I am so happy for the new video!!!
@homealone89464 жыл бұрын
Dojo, man this was a crystalclear explanation. Thank You very much.
@proggaparomita281 Жыл бұрын
KZbinrs I owe my whole degree: CS Dojo, Code with Harry and Organic Chemistry Tutor .
@BoopeaTech Жыл бұрын
You're great. The explanations are really broken down. Thank you👍
@hmchemistry78834 жыл бұрын
Thanks CS Dojo. The practice problem was fun! public static int ShiftedBinarySearch(int[] array, int target){ int l=0, r=array.length-1, mid=0; while(larray[r]){ mid=(l+r)/2; if(array[mid]==target) return mid; else if(array[mid]array[mid] && target=array[l] && target
@sase10173 жыл бұрын
I think there is a mistake with last part of pointer movement when target = 12, when left pointer will be equal to right pointer, we will exit the while loop(Left = right) with return -1, left and right pointers will not pass over each other.
@frixaco4 жыл бұрын
Reaaly great explanation! Thank you very much and continue these series!
@lysekthe4 жыл бұрын
I applied this algorithm in my work, thank you!!!
@niquebon3 жыл бұрын
THANK YOU! for saving me always. Your tutorials are easy to understand compared to others. Great teacher!
@jahanvi94293 жыл бұрын
You are my saviour!!!!! thank you so much. i was having so much trouble with this
@DatascienceConcepts4 жыл бұрын
Nice explanation! Searching Algorithms are super interesting and important :)
@arjunthecoder4 жыл бұрын
Love this video. Great Refresher!!!
@KevinGarcia-ws1kt Жыл бұрын
Thank you for this video. That was a really clear explanation
@TheMatias23 жыл бұрын
Best explanation I found on YT! thanks!
@erza48764 жыл бұрын
It would be great if you can share some experience in dealing with conditions in binary search templates, e.g., left < right or left
@feding33283 жыл бұрын
Thank you so much CS Dojo
@shubhamiot3264 жыл бұрын
Keep on making videos... Salute from india
@kumaracademy75554 жыл бұрын
I am your student from India❤
@pranavm25394 жыл бұрын
Me too
@mokshanirugutti4 жыл бұрын
Same
@vivekpatel55554 жыл бұрын
Me too
@GhostVaibhav4 жыл бұрын
Bro, increase the frequency of ur videos!! It will be of great help to everybody..!
@iig10174 жыл бұрын
Great video with a lot of information. Thank you for all!
@fazeefathima10414 жыл бұрын
Thanku so much sir, I am your subscriber from INDIA✌️😊
@plor12614 жыл бұрын
Great teaching and it was very fun to learn!
@sriramkasu75114 жыл бұрын
Finally he is back with this series
@maddada4 жыл бұрын
Very clear explanation, thank you very much! Please keep them coming
@HShravzP4 жыл бұрын
This is so helpful. Thankyou and please continue this series :)
@nandhakumaranm60064 жыл бұрын
Please continue the python series. Really waiting for more videos. I have started learning by watching your videos plz do teach more
@maulanaputro19664 жыл бұрын
Really looking forward to your next videos in this series!
@samsungfateh86864 жыл бұрын
Thank you for your very useful tutorial videos My English is not very good. Thank you for always subtitling the videos I wish you good health and increasing success from God Almighty
@saiint99914 жыл бұрын
Good stuff❤... Continue all concepts related to data structures.
@madhavgoyal10684 жыл бұрын
YK! Kindly do complete this Playlist as I don't wanna wander about different places after already starting your Playlist. Thanks. ~ FAN
@iamakifislam4 жыл бұрын
Thanks. I was waiting for this video ! Please continue DS and Algo Series
@anuragd3984 жыл бұрын
Back at it again with the good stuff YK
@diveshkosuri55943 жыл бұрын
You just made it so simple! Thanks
@mdsaifalam98234 жыл бұрын
Hello Dojo I am your student from India.💕💕
@surajk65504 жыл бұрын
Where from India brother
@Devakvp2 жыл бұрын
Clean explanation! Thank you so much!
@masqueradeee4 жыл бұрын
Thank you so much great explanation 👍 pls upload more videos on Data structures.
@shivamgahoi3 жыл бұрын
I believe when target=12 eventually L=value 13 or index 7 and right = value 11 or index 6... So this is a mistake in video @12:05 ... Please correct if possible... By the way awesome content... Love from India ❤️😍
@kR0N0Z6184 жыл бұрын
these videos are a godsend. very well articulated! keep it up! i look forward to more videos in the series!
@yathirajraghavendra16744 жыл бұрын
Please do continue this DSA course.. I am your student from India. . You are my fav youtuber
@nareshreddy33443 жыл бұрын
Please continue this series
@IkramIkram-gm3zg3 жыл бұрын
do u please know how can we solve the problem given at the end ?
@fayazansari28274 жыл бұрын
Next Upload a video about different types of algorithm such as dynamic, greedy etc. Please 🙏
@Raj_Tanvar4 жыл бұрын
Thanks a lot for such a great video... Well explained easily understandable
@vulnerablegrowth37743 жыл бұрын
Ok, so binary search only works if the list is sorted or sorted+shift, correct? But, I then I have a question. Why not check if the target is more or less than the range of values before starting the loop? We just assume that’s less likely to happen so we’d rather go straight to checking targets which can be found first? As in, “hey, if you sent us a target that doesn’t fit in the list, you’re gonna have to wait.”
@dexteritylord17254 жыл бұрын
Thanks a lot for your effort. please make a tutorial on Merge sort algorithm + quick sort algorithm
@JMBTV19884 жыл бұрын
Wow.. thank you for this tutorial. I badly needed this one
@udoyonb2744 жыл бұрын
This is brilliant! Thank you so much!
@wisdomovermoney33943 жыл бұрын
You made it so simple.
@codingbro34994 жыл бұрын
Dojo you are my programming inspiration
@akashk__68944 жыл бұрын
Your videos are really helpful ! continue your good work .
@parteeks90124 жыл бұрын
class Solution { public: int search(int A[], int n, int target) { int lo=0,hi=n-1; // find the index of the smallest value using binary search. // Loop will terminate since mid < hi, and lo or hi will shrink by at least 1. // Proof by contradiction that mid < hi: if mid==hi, then lo==hi and loop would have been terminated. while(loA[hi]) lo=mid+1; else hi=mid; } // lo==hi is the index of the smallest value and also the number of places rotated. int rot=lo; lo=0;hi=n-1; // The usual binary search and accounting for rotation. while(lo
@hakanaki2 жыл бұрын
do you have a tutoral on Hash maps, Stacks/Queues/Heap/Priority Queue ?
@trongdoan8173 жыл бұрын
super clear instruction. Thank you.
@setarehsh37494 жыл бұрын
KZbin... It's not giving me notifications even though I put it to all.. 😐 Thank you for all the free info!
@sidheshwartiwari98344 жыл бұрын
And I am getting notifications from channels I never even subscribed to ,let alone clicking the bell icon. What a tragedy🙄
@setarehsh37494 жыл бұрын
@@sidheshwartiwari9834 LoL
@aznguyener3 жыл бұрын
nice series! please continue
@p_square4 жыл бұрын
Legend back again!!
@nguyenlethuong1864 жыл бұрын
I like your explanations and I'd love if u make more videos like this
@SourLemonFan4 жыл бұрын
Thanks for your help! These videos are amazing!
@nationhlohlomi93332 жыл бұрын
Great video as always
@shreya12013 жыл бұрын
such a good explanation!
@eduardomartinez65214 жыл бұрын
Thanks for the lesson !. Do you have any video or resource where you list or describe the personal projects you did before you applied for Google?
@anamika59844 жыл бұрын
Bro please continue this stuff🙏
@unknownunknown86992 жыл бұрын
why u gotta check n/2 elements its a computer always starts from 0 to n numbers search(array, the value u r searching for) so where did the n/2 come from ? is it something i should just memorize ?
@porobertdev5 ай бұрын
I suppose you're talking about Time Complexity. He broke down the number of steps an algorithm has to take when searching within 40 elements, showing how we get to the O(log N) aka logarithmic time complexity. Since this algorithm halves an array until the element is found or halved's length is 1, that means the first halved array would be n/2, where n is the length of the array. If the element is not found, then n/4 if we use the main array's length, otherwise we could say n/2 of the halved array. I don't think it's important to memorize this, but you should remember that whenever an algorithm keeps halving an array by looping or using recursion, then the time complexity should be O(log N). You can test that by doubling up the size of the input, and see the difference between the number of steps. As per its definition, O(log N) states that the number of steps grows by 1 when the input size is doubled.
@elmehdimedrani12404 жыл бұрын
Thank you for sharing this content!
@programmingwithjackchew9034 жыл бұрын
can I know for the binary search only can suitable for ascending order and not suitable for the elements in the list that Is not order right for example [-2,3,1,8,6]
@waisetsubunsho7934 Жыл бұрын
Why is there no condition for when target is < left or > right? Or just plain =left or =right?
@valacascrane91564 жыл бұрын
You are quite an inspiring guy. Keep on!
@spacewitch99873 жыл бұрын
your videos are so helpful, dude. tysm! ;u;
@ahammedafzal77974 жыл бұрын
Will you teach it completely? Can someone familiar with python understand this course(knows only little about c)?
@picumtg56314 жыл бұрын
yeah ofc. His pseudocode is basically python. The only difference between python and c on the complexity of his program is that there are ; at the end of each command(where in python there is nothing behind it) and some random brackets like ()[]{}after if and while and for loops. If you just pretend they are no brackeys there there you are fine
@haddonjames58293 жыл бұрын
great explanation
@ameiragha24194 жыл бұрын
I am really appreciate your effort CS Dojo. if it’s possible can you make next episode about hash table? Peace.
@mnt862 жыл бұрын
9:23 But doesn't array.length make the code go through each element in the array in the background to count how many elements are there in the array? If so, then what's the point of using binary search instead of linear since it'll iterate anyway?
@champagnepop4 жыл бұрын
Can I just sort the unsorted array that was given in the problem? Then apply with the given solution?
@saksh.j4 жыл бұрын
Hey dojo. I've recently started to get intrest in computers and coding - I'm an extreme beginner. So which video of yours i should watch or what basics should I start or begin with. Thank you
@Raj_Tanvar4 жыл бұрын
Bro, Please continue this series on data structures and algorithms & please keep continue with python code as wll