I’m currently a CS student at UofSC Columbia and YOU played a major role in me getting an A in my first Java class and it looks like you’re also gonna play a major role in me passing the second one. I know when I get my degree you will deserve half the credit good sir. Each of your videos are easily more valuable than a week of in class lectures! Thank you
It's sad that I'm at UBC - O, and I have to use John's videos to understand the content and prepare for the final...Sometimes the profs are just sloppy and clueless...
I'm a Senior Dev in Java and I just discovered your videos this week. Even though i'm experienced in the language I feel like I still learn things from watching your content, the way you explain things is incredibly easy to grasp. Please keep making more content, I think you are much better than other channels or even paid courses I have taken in the past.
I want to add one important thing about moving high and low pointers to the "right" or "left" of middle pointer (mid+1 or mid-1), it's not just because we want to exclude the number (index) which out of our concern already since we know that if our searched value is not equal to the middle pointer value then there is no reason to ever deal with it again. But doing such kind of things (+1 or -1) ensures that we won't be stuck in an infinite loop (in case your searched value is not presented in the array).
Hi Sir, I have watched every video of Java on your Channel. You are Extremely Super in Teaching Java. And now I want to Learn Java Spring Boot. And I think you are the best teacher to teach Spring Boot in Java. And it is also Tending Technology. So I am telling you to create a playlist on Java Spring Boot. And it will help all the people who want to learn Java Spring Boot. Thank you sir ❤
Started learning Java two weeks ago. Your videos are godsent. Really enjoying them. I would very appreciate if you could make video about managing workspace, projects, files and jdks (jres) in Eclipse. I'm having little trouble with understanding all that. Much thanks.
From my experience I would recommend to use half-open intervals instead of segments in all algorithms that use intervals like binary search, sortiing, segment tree and so on. It allows to decrease number of +1/-1 in the code, and this +1/-1 is a place where people often make mistakes. private static int binarySearch(int[] numbers, int numberToFind) { int low = 0, high = numbers.length;
while (low + 1 < high) { int middlePosition = (low + high) / 2; int middleNumber = numbers[middlePosition]; if (numberToFind < middleNumber) { high = middlePosition; } else { low = middlePosition; } } if (low < numbers.length && numberToFind == numbers[low]) { return low; } else { return -1; } }
Your explanations are easy to understand. It might be your voice or your choice of words but whatever it is, I'm thankful that I am able to fully grasp the concept more easily this time compared to when I took it 2 semesters ago. Looking forward to more videos in the future!
Great vid John, but here is a little thing you didn't mention about the built-in binary search method: If the number that we looking for is not in the array, the built-in method returns -(insertion point). So for example, if the array contains the following values {1, 2, 4, 5, 7, 9, 11}, and we would like to find 8, it would print -6.
Hi John, great video. But here is a small correction. The result of looking for the number 8 should have been -6. Because binarySearch returns the index where the missing number should be -1 (-(insertion point) - 1). But for an exercise is really cool. Thanks for your time 🙂
This is not a correction, it's a different way of doing it. Java's built-in library does it this way, John does it by always returning -1 when not found. Depends on if you actually want to know where the missing element would be though.
John I love your Java videos and I really think you're one of the best Java instructors here. I was wondering if you'd consider explaining a Java login project one day with a useful framework, or adding it to your course. That would be so awesome.
Hey John, amazing videos you got here on your channel. You are really playing in an own league, thank you very much helped me a ton! Would you mind doing a video about Iterator aswell?
Your videos are really helpful and good for students like me. If only you can start a series of leetcode solving regularly that would be game changer for us. Whether you upload something or not try to upload problem solving question. thank you
@@CodingWithJohn I've watched more than 10 videos of yours in last couple of days. Learned a lot! I'd love to see some Design Patterns content (implemented in java) on your channel.
Hi John, I really enjoy your videos and the way you explain java in general, so thanks about what You do I am sure loads of people do appreciate it too. I wonder if You have plans to do a video about GUI any time soon? I would love to see one (if this can be done in one video of course) as I am about there in my java study right now
Professor your explanation is genius. Can you help me in an additional part, like if I want to print "Sorry we cannot find the number" instead of -1 what are the changes can we make to modify this code? THANK YOU in advance.
Hey john i have a doubt in java, what is the difference between object and instance , please could you make a brief video of that it will very useful to all , and make more understanding of the fundamentals in java
Hi John, I'm curious to know for the experience you have in the software industry, what were the concepts in Java that were crucial in any scenario apart from basic control structures? Any design patterns/frameworks? Any concepts like Inheritance/ Overloading / Overriding etc? Thanks.
I've seen in some binary search realizations that formula to calculate middle pointer looks like that: low + (high - low) / 2. Why is that? Also, inside Arrays class this part of binary search looks like: (high - low) /2 >>> 1. How to read such code? What >>> 1 does in this case?
Hello, this video was again, awsome, you though me so much during year 2022. I do have a request. Could you make a video about How to use Java with server requests and some things aroud this topic (URL's or something; I'm not really educated in this so please forgive me if I described it badly 😀)
hi, john, can you make a episode about the backslash usage in java regex please? such as the "\\\\" impies the "\" in java. it is tricky to understand.
Great explanation of binary search. But there's a bug in your method. If you pass in an empty array it'll fail since you'll be trying to pull the number from index 0. But since the array is empty, it'll throw an IndexOutOfRangeException.
Hello, grab the source code and give it a try! An empty array does not throw an exception in the way you described. The reason is this: int low = 0; int high = numbers.length - 1; while (low
Is a good way to think of Binary Search is that if you have a physical dictionary, you’re starting at the middle and going left or right in sections as opposed to starting from the beginning or end of a dictionary? Correct me if I am wrong.
Hii John Thankyou soo much for all your efforts, if possible can you start making videos on java8 features mostly on stream and its supporting methods like we have many in this streams i,e distinct,averaging int,groupingby,mappingby, etc Thanks in advance
My man, we were just covering this in college this week and you happen to be much better at explanations than our professor. You're a legend!
College makes more money the longer it takes, it feels like an expensive scam because it is. Learning is best done elsewhere.
@@theseriousaccount It's always good to learn something.
tell your professor that face to face
Yes, 100 points!
Why do I have to learn this in class 10 😭
I’m currently a CS student at UofSC Columbia and YOU played a major role in me getting an A in my first Java class and it looks like you’re also gonna play a major role in me passing the second one. I know when I get my degree you will deserve half the credit good sir. Each of your videos are easily more valuable than a week of in class lectures! Thank you
It's sad that I'm at UBC - O, and I have to use John's videos to understand the content and prepare for the final...Sometimes the profs are just sloppy and clueless...
You are that one good teacher which this world doesn't deserve but totally needs
I am a 10 th grade student from India and dont know binary search thank u so much u deserve millions of subscribers 😊
I'm a Senior Dev in Java and I just discovered your videos this week. Even though i'm experienced in the language I feel like I still learn things from watching your content, the way you explain things is incredibly easy to grasp. Please keep making more content, I think you are much better than other channels or even paid courses I have taken in the past.
Pray your boss doesn't discover this comment, you will be demoted to juniors at best!
how are you a senior and still don't know the basic sorting algorithm?
Every time I need to understand something better I go to UA-cam hoping that you’ve covered it …🙏 Thank you so much!!
I want to add one important thing about moving high and low pointers to the "right" or "left" of middle pointer (mid+1 or mid-1), it's not just because we want to exclude the number (index) which out of our concern already since we know that if our searched value is not equal to the middle pointer value then there is no reason to ever deal with it again. But doing such kind of things (+1 or -1) ensures that we won't be stuck in an infinite loop (in case your searched value is not presented in the array).
john is so good at explaining i could binge watch these tutorials and not get bored
Have at it!
@@CodingWithJohn Hey man, i love so much your videos im a student, im very excited, i want to see videos about Java GUI awt spring
Wow especially with a lot of data, binary search goes really vast and saves a lot of time and energy. thank you John.
i was waiting for it! Please do more videos on algorithms and problem solving in general
+1
+2
@@nenuanenenuane6645 It's always good to learn something.
@@abhiram2369 It's always good to learn something.
@@programmingwithnurulhuda It's always good to learn something.
you're my end of search as Java Teacher.. no matter what algorithm we use.. 😀
Thank you sooo much. I stopped watching my paid udemy Java courses after I found your channel. REALLY!
Thank you sir, you're helping alot of icse school, 10th graders 💞
man you're my rescuer, with sincere love and appreciation
Excellent explanation to prepare for a quick interview
The best explaining ever ! Clarity is top notch John ! Sending gratitude from SriLanka! ❤
Such an excellent communicator - I wish to become as articulate as you. Amazing video!
Damn I have my AP Computer Science A exam tomorrow, you're literally gonna save me :D Thanks!
Thank you brother! Please don't stop teach us!! God bless you!
Hi Sir, I have watched every video of Java on your Channel. You are Extremely Super in Teaching Java. And now I want to Learn Java Spring Boot. And I think you are the best teacher to teach Spring Boot in Java. And it is also Tending Technology. So I am telling you to create a playlist on Java Spring Boot. And it will help all the people who want to learn Java Spring Boot. Thank you sir ❤
I think you are one of the best Java tutorials videos done in UA-cam , can you done tutorials for spring boot
Started learning Java two weeks ago. Your videos are godsent. Really enjoying them. I would very appreciate if you could make video about managing workspace, projects, files and jdks (jres) in Eclipse. I'm having little trouble with understanding all that. Much thanks.
One video watched, and boom! I became your subscriber. You''re really good with explanations. Congrats!
thank you John wonderful video
I will use this on my arrays homework, I have some ideas I want to accelerate faster.
So well explained. Thank you John for coding and explaining each step. Much better than our professor could do!
first attempt and your explanation is very clear
John , you are the best programmer-blogger I ever seen. Ukraine is watching you right now 🇺🇦❤️
From my experience I would recommend to use half-open intervals instead of segments in all algorithms that use intervals like binary search, sortiing, segment tree and so on. It allows to decrease number of +1/-1 in the code, and this +1/-1 is a place where people often make mistakes.
private static int binarySearch(int[] numbers, int numberToFind) {
int low = 0, high = numbers.length;
while (low + 1 < high) {
int middlePosition = (low + high) / 2;
int middleNumber = numbers[middlePosition];
if (numberToFind < middleNumber) {
high = middlePosition;
} else {
low = middlePosition;
}
}
if (low < numbers.length && numberToFind == numbers[low]) {
return low;
} else {
return -1;
}
}
Your explanations are easy to understand. It might be your voice or your choice of words but whatever it is, I'm thankful that I am able to fully grasp the concept more easily this time compared to when I took it 2 semesters ago. Looking forward to more videos in the future!
I prefer to make my middle position variable "pointer" but nice simple explanation here!
This is such a good timing to what I am learning in class right now in college. Thank you John!
Great vid John, but here is a little thing you didn't mention about the built-in binary search method: If the number that we looking for is not in the array, the built-in method returns -(insertion point).
So for example, if the array contains the following values {1, 2, 4, 5, 7, 9, 11}, and we would like to find 8, it would print -6.
Nice! Didn't realize that about the built in one, that's a nice feature
Your DSA lectures are making me pass my IVs, damn it I'll repay you one day!!
Short and sweet, thank you for an amazing video
Hi John, great video. But here is a small correction. The result of looking for the number 8 should have been -6. Because binarySearch returns the index where the missing number should be -1 (-(insertion point) - 1). But for an exercise is really cool. Thanks for your time 🙂
This is not a correction, it's a different way of doing it. Java's built-in library does it this way, John does it by always returning -1 when not found. Depends on if you actually want to know where the missing element would be though.
Hey please don't stop uploading videos you are gret
Very informative and useful video! Thanks!
Yaay love it! more data structures and algorithms please 🙏
Implement red black tree in java.. Using enums
This is very good content and explained in very simple manner!! Please try to create tutorials on concurrency and parallelism.
Thanks John for making these vids; we appreciate your time and effort(s).
Amazing, amazing, amazing explaination John!!
John I love your Java videos and I really think you're one of the best Java instructors here. I was wondering if you'd consider explaining a Java login project one day with a useful framework, or adding it to your course. That would be so awesome.
Jhon why dont you start a tutorial about Spring? Thanks to you I learned Java and now I am having some problem with spring without your video! 😁
You`re carrying my grade, I love u
I just needed this!!! You're a savior🙏🙏🙏
Too helpful to describe in words...
It is very simple and intuitive.😮😮😮😮
It's always good to learn something.
very good and clear explanation
Hey John, amazing videos you got here on your channel. You are really playing in an own league, thank you very much helped me a ton! Would you mind doing a video about Iterator aswell?
cool video, it would be cool to hear about faster search and sorting algorithms
Hey john, thanks for all your tutorials, I would like to see you doing one project with all the oops concepts if that is possible
John! I love your vids man, Could you do a Linear Search algorithm?
I'm honestly having struggles with that algorithm, very much appreciate it
Your videos are really helpful and good for students like me. If only you can start a series of leetcode solving regularly that would be game changer for us. Whether you upload something or not try to upload problem solving question. thank you
Thanks Jhon!
Great explanation 👌! First time watcher here, will watch more of your content.
Thanks a ton! Hope they're helpful, and let me know if there's anything you'd like to see!
@@CodingWithJohn I've watched more than 10 videos of yours in last couple of days. Learned a lot! I'd love to see some Design Patterns content (implemented in java) on your channel.
and also congrats on 200k subs!!! 🥳🥳🎉🎉🎉
Thank you John! I 've been digging into search algorithms, lately. It's great to see you made another great video for it.
Hi John! Love your videos!!! May you make one on the big O notation? Thank you!!!
Excellent tutorial
Thanks so much. It really helps.
Can you please upload a video explaining "Static" keyword? Thanks again!
Fantastic explanation, as always! Can you also make a video on the Big O notation?
This was helpful. Thanks!
Wow, this is awesome explanations, thank you 😃
its great video
I love your videos, you're fantastic
Nice detailed tutorial!
I think it's better/safe to sort the array first @Line12 -->>> numbers = Arrays.stream(numbers).sorted().toArray();
Hi John, I really enjoy your videos and the way you explain java in general, so thanks about what You do I am sure loads of people do appreciate it too. I wonder if You have plans to do a video about GUI any time soon? I would love to see one (if this can be done in one video of course) as I am about there in my java study right now
woah wtf this was posted at the perfect time. I searched this up thinking it was one of your older videos lmao
Nice! I stole the thumbnail pic from an older video (forgot to take a new one...) so maybe that thre you off
yeah man do more prob solving stuff ,really need them in java
can you make a video about time complexity of algorithms and Big O, Big Ω etc, notations please??
could you make video about static in class. how it works and where we should use it in
thanks for sharing!
Can you do a video about how ChatGPT is changing the coding scene, and its potential consequences?
Thank You Sir
Professor your explanation is genius. Can you help me in an additional part, like if I want to print "Sorry we cannot find the number" instead of -1 what are the changes can we make to modify this code? THANK YOU in advance.
very thoughtful idea
Hey john i have a doubt in java, what is the difference between object and instance , please could you make a brief video of that it will very useful to all , and make more understanding of the fundamentals in java
Thanks for the video
I love your videos but i was wondering what editor are your using? Keep up the awesome videos!!
Thanks! I use DaVinci Resolve to edit my videos, it's free and offers everything I need.
Great sir...
Thnx for the wonderful tutorial and keep up the good work => Btw you look like Mark Strong/ Jhonny Sins 🙂
Hi John, I'm curious to know for the experience you have in the software industry, what were the concepts in Java that were crucial in any scenario apart from basic control structures? Any design patterns/frameworks? Any concepts like Inheritance/ Overloading / Overriding etc? Thanks.
all of them are equally important
I've seen in some binary search realizations that formula to calculate middle pointer looks like that: low + (high - low) / 2. Why is that?
Also, inside Arrays class this part of binary search looks like: (high - low) /2 >>> 1. How to read such code? What >>> 1 does in this case?
Sane question…. Did you get any answer on low+(high-low)/2?
Hello, this video was again, awsome, you though me so much during year 2022. I do have a request. Could you make a video about How to use Java with server requests and some things aroud this topic (URL's or something; I'm not really educated in this so please forgive me if I described it badly 😀)
you know how good your video is? when a 17 minutes video felt tile 5 minutes.
Thanks sir
hello sir, again with another wonderful video , i would like to ask you if you can make a video about Dependency Injection in java
hi, john, can you make a episode about the backslash usage in java regex please? such as the "\\\\" impies the "\" in java. it is tricky to understand.
That is great , can you make future vedios like this for other search and sort algorithms and it will be great to explain cone 🥰
I have a bunch of sorting algorithm videos already, so check them out! Any particular sort or search algorithm I haven't covered you'd like to see?
@@CodingWithJohn It's always good to learn something.
Great explanation of binary search.
But there's a bug in your method.
If you pass in an empty array it'll fail since you'll be trying to pull the number from index 0.
But since the array is empty, it'll throw an IndexOutOfRangeException.
Hello, grab the source code and give it a try! An empty array does not throw an exception in the way you described.
The reason is this:
int low = 0;
int high = numbers.length - 1;
while (low
@@CodingWithJohn damn you're right...I was watching on my TV, so couldn't test it :p
No worries, thanks for watching!
Is a good way to think of Binary Search is that if you have a physical dictionary, you’re starting at the middle and going left or right in sections as opposed to starting from the beginning or end of a dictionary? Correct me if I am wrong.
That's a great way to think about it!
Hii John Thankyou soo much for all your efforts, if possible can you start making videos on java8 features mostly on stream and its supporting methods like we have many in this streams i,e distinct,averaging int,groupingby,mappingby, etc Thanks in advance
Come teach at my School. the other day i watched your recursion video you explained it 10 times better than my goofy ass tenured professor .
how convenient, I got an algo exam tomorrow.
Good luck on your exam!
Sir please do a video on apache maven
Thanks John . i have a question
if our array was int[] ={1,2,4,5,7,9,11,12}
What search algorithm would we use? (fast)
It doesn't matter what the array is, binary search does the job.
1B elements, 168852 mills. 64G of memory.
00:07:21 Thank You, Any reason to declare private method as static ?
can we do the same but without hard coding the values ? like ask the user to enter all the vales and the target value ?
Will the user be sorting the numbers while they enter them?
If not, will there be a way to put the numbers in ascending order?