Python - Greatest Common Divisor W/ Recursion

  Рет қаралды 7,690

Wrt Tech

Wrt Tech

3 жыл бұрын

With the help of Euclid's algorithm, we create a GCD function recursively. GCD of 2 integers

Пікірлер: 10
@abdallahsiyabi4784
@abdallahsiyabi4784 2 жыл бұрын
Thumbs up for a great explanation of call stacks. I used to think recursion updated first func call, like this function would terminate because b == 0 as a result of recursion. Thanks man.
@wrttech422
@wrttech422 2 жыл бұрын
Glad it was helpful!
@kacpermokrzycki2144
@kacpermokrzycki2144 3 жыл бұрын
as a curiosity you can also write def GCD(a,b): return a if b==0 else GCD(b,a%b) if anyone is obsessed with shortcode :))
@th3crypt
@th3crypt Жыл бұрын
Such Talent, dope g
@donpilarsuarezgudino5160
@donpilarsuarezgudino5160 2 жыл бұрын
Fantastic!! Of course I`ve learned something. What a lecture, man. Thanks a lot.
@wrttech422
@wrttech422 2 жыл бұрын
Glad it was helpful!
@dillic8656
@dillic8656 Жыл бұрын
Thank you so much for explaining, this video helped me out alot.
@BrainyiFY_o0
@BrainyiFY_o0 Жыл бұрын
Best video love it ❤❤❤
@RahulSharma-oc2qd
@RahulSharma-oc2qd 2 жыл бұрын
superb explanation...
@Silent_poet
@Silent_poet 7 ай бұрын
Why the viewcount is so low
Recursion Simply Explained
27:58
NeuralNine
Рет қаралды 8 М.
Python Tutorials - Program To Find out the GCD of Two Positive Numbers
13:11
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 59 МЛН
Scary Teacher 3D Nick Troll Squid Game in Brush Teeth White or Black Challenge #shorts
00:47
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 128 МЛН
GCD - Euclidean Algorithm (Method 1)
14:38
Neso Academy
Рет қаралды 514 М.
Programming Loops vs Recursion - Computerphile
12:32
Computerphile
Рет қаралды 1,4 МЛН
Python Program #25 - Find HCF or GCD using Loop in Python
7:40
Programming For Beginners
Рет қаралды 2,3 М.
Recursion Example Python: Greatest Common Divisor (GCD)
8:42
Dr M. Adeel Ajaib
Рет қаралды 1 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 795 М.
Tail Recursion Explained - Computerphile
16:05
Computerphile
Рет қаралды 170 М.
Python Program #26 - Find HCF or GCD using Euclidean algorithm
6:08
Programming For Beginners
Рет қаралды 2,2 М.
9. Tower of Hanoi in Python | Recursion | Python Lectures |
14:02
Anjali Sharma
Рет қаралды 6 М.
Python Tutorial: File Objects - Reading and Writing to Files
24:33
Corey Schafer
Рет қаралды 1,7 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 59 МЛН