Program To Find GCD Or HCF Of Two Given Numbers In Java | FREE DSA Course in JAVA | Lecture 8
ฝัง
- เผยแพร่เมื่อ 27 พ.ย. 2022
- Data Structures and Algorithms Free Course (Learn DSA Without Paise) Playlist - • Data Structures And Al...
We are up with the lecture 8 of our much awaited dsa course in java.
As we are proceeding with our mathematics module of our DSA course, today we will learn how to find the greatest common divisor or highest common factor of given two numbers.
This is a very basic concept in your journey to competitive programming or many a times companies directly ask for GCD or HCF of two given numbers in the coding round of placement.
Hence in our data structures and algorithms series, we feel it is important for you to learn the method to find the gcd/hcf of two number.
In this video we will learn the complete logic behind the program using the AR technology as well as a proper code for the same.
So without wasting any time, let's jump to our lecture 8 of free dsa course for job placement in java.
Subscribe to our channel for regular updates on the dsa course and click on the bell icon to never miss an update from our dsa course.
For more information, fill this form: forms.gle/8eiUmM92Fx563Aen9
or call us at 8884881203
Facebook: / thetapacademy
Instagram: / tapacademy_online
Linkedin: / 73820805
Website: www.thetapacademy.com
#dsa #dsacourse #java #dsainjava #javaprogramming #coding #coder #gcd #hcf
The video might seem too long for people who are looking for a GCD/HCF program. However, once you watch it, the concepts will stick with you and help you whenever you think of GCD and HCF programs. I am a big fan of this man's explanation. Hats off to him!
Seriously no words!! this lecture was just perfect. I dint even realize that it was 43 mins video👏👏 Totally worth it💯
Glad you liked it! Do subscribe to the channel.
@@TAPACADEMY done already.. pls post videos that helps in logic building in java.. i am working as backend developer in Java.. it will be so helpful 😊
This channel deserves millions+ Subscriber's
Such an amazing explanation 🙀
The best thing is that he covered all exceptions and errors which we will definitely do and it will remember in our mind great explanation
I'm truly amazed by how wonderfully you explained this. Your explanation has left me in awe. Please continue to share your videos, sir!
Oh my God!, such an amazing explanation. Your video was just recommended by TH-cam and I watch it from start to end. Thanks a lot, man.❤❤❤
you make every algo so simple and easy.Kudos for your effort.
mann you are insane !! loved the way you taught!
the way you explain things and make them look so easy is just amazing. keep up the good work man. loves from germany,.
My god it's unbelievable,this man has explained everything crystal clearly,I feel extremely happy to find this video Thanks a lot sir👏
@TAPACADEMY Can you please clarify at 42:50 why the Optimized Euclid Algorithm has O = log(Min(a,b)) ? Since the iterations occur for Max value and we keep dividing the Max value hence it should be O = log(Max(a,b)) right?
Sir I have became your fan, by seeing this single video. Literally great 👍 👌 👏 .Not getting any words to appreciate your explanation. Really amazing explanation.
Excellent. Amazing. Hats off
Best/Perfect Explaination ever ..... 💥
Wow! Your explanation is spot on. Thank you, sir, for providing such informative content.
Really great explanation.
Excellent man,superb explanation
the best explaination ever!
Sir the way that you are teaching its equal to that Gabriel lame algorithm that reduce reduce our time complexity and Save our data also , because after watching your video We do not have to open any other video Sir you have amazing communication skill. 🙏🙏🙏🙏
Superb explanation 👌 . I never seen thease kind of quality lectures and explanation before.
Glad to hear that. Stay tuned and do share our course in your community.
Sir good job sir I understand fully clear
beautiful explanation sir!!
just perfect in one word i can say u are!!!the way u explain omg xoxo
Great explanation
This video is incredibly informative! I've been struggling with this concept for a while, and your explanation made it so much clearer.
Glad to know this. Do subscribe to our channel and share it within your community.
Excellent💯👏
Awesome 👍👍
Amazing 🎉🎉
Thank you sir ❤
very nice and typemaster also greate.
Super se upar 👍🏻
yes we are able to think sir!!😀😀
Great explaination i wish everyone teaches like you :) it will be easier to understand dsa.
Thanks man. Do subscribe to the channel for regular tips and lecture updates of the dsa course.
nice explanation
Best explaination! Thankyouu so much to make this a easy one
You're welcome 😊
you are criminally underrated
can you please explain how to understand the logic for leetcode and hacker rank problems. your explanation is very good and understand easily
when calculating frequency 'i' value will be 'i--' (post decrement) not 'i++ '.thanks for this video sir.16:22/43:24
❤
You are really awesome......
Please make a video of how to calculate LCM of an array
We have made a video on how to calculate LCM in our DSA course. You can use similar concepts.
Sir ,it should be (log(max(a,b))) not O(log(min(a,b))) as this is a optimised version of Euclid algorithm only in gabriel lame algorithm
can you explain 17:00 , how min+1 will be the frequency , it will be min only sir.
what about this code sir ?
static int hcf(int x , int y) {
if(y==0) {
return x;
}
else {
return hcf(y,x%y);
}
}
public static void main(String[] args) {
int x = 0;
int y = 19;
System.out.println(hcf(x,y));
}
}
41:32
One day this channel will become A million followers channel
Great work by you sir
please upload 3 or 4 videos daily ..my humble request
Hlo bro
// please calculate time complexity in this program .
class gcd {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
System.out.print("the gcd is: " + a);
}
}
amazing bro