Tower Of Hanoi | Simple Story | Story To Code | Recursion Concepts And Questions | Video 7

Subscribers:
92,300
Published on ● Video Link: https://www.youtube.com/watch?v=FfUE6gtqOB4



Duration: 25:14
550 views
51


iPad PDF Notes - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad%20PDF%20Notes/Recursion%20Concepts%20%26%20Qns%20-%207.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
This is the 7th video of our playlist "Recursion Concepts And Questions". Find the Details below :

Video Name : Tower Of Hanoi | Simple Story | Story To Code | Recursion Concepts And Questions
Video # : 7
C++/Java Code Link : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Recursion/Tower%20of%20Hanoi.cpp
GfG Problem Link : https://practice.geeksforgeeks.org/problems/tower-of-hanoi/0

πŸ” Unraveling Recursion: A Journey into the Depths of Code

πŸŽ₯ Welcome to the 6th Video of my Recursion Playlist! πŸš€ In this enlightening video, we will solve a very famous recursion problem "Tower Of Hanoi" with the help of Recursion. We will start with a Simple story understanding with Tower Of Hanoi Diagram and then we will be Converting Story to code and writing the recursive code for Tower Of Hanoi and also I will also be explaining the Time and Space Complexity of the code 🌐

πŸ” What's Inside?

πŸ”— Simple story understanding with Tower Of Hanoi Diagram

πŸ”— Converting Story to code and writing the recursive code for Tower Of Hanoi

πŸ”— Explanation of Time and Space Complexity of the code

πŸ‘©β€πŸ’» Who Should Watch?

This playlist is for everyone but best suited for Freshers who are new to Recursion.

πŸš€ Embark on the Recursive Adventure Now!

My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls
My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Subscribe to my channel : https://www.youtube.com/@codestorywithMIK
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK


Approach Summary : The Tower of Hanoi problem involves moving a stack of n disks from one rod to another, using a third rod as an auxiliary, such that no larger disk is placed on top of a smaller one during the process. The toh method takes four parameters: n (number of disks), from (source rod), to (destination rod), and aux (auxiliary rod). The function recursively solves the Tower of Hanoi problem, printing the steps to move each disk from the source rod to the destination rod. The count of total moves is returned. The base case is when n is 1, in which case it directly moves the disk and returns 1. Otherwise, it recursively solves the problem for n-1 disks, prints the move for the current disk, and then again recursively solves the problem for n-1 disks on the auxiliary rod. The total count of moves is calculated and returned.

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
β•‘β•šβ•£β•‘β•‘β•‘β•šβ•£β•šβ•£β•”β•£β•”β•£β•‘β•šβ•£β•β•£
β• β•—β•‘β•šβ•β•‘β•‘β• β•—β•‘β•šβ•£β•‘β•‘β•‘β•‘β•‘β•β•£
β•šβ•β•©β•β•β•©β•β•©β•β•©β•β•©β•β•šβ•©β•β•©β•β•

✨ Timelines✨
00:00 - Introduction
0:14 - Motivation (Bhashan)
00:47 - Problem Explanation
5:23 - Intuition Building
6:33 - Writing Story Points
13:48 - Story To Code
17:06 - Time Complexity and Space Complexity
22:02 - Let's Code it up

#codestorywithMIK
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #2024 #newyear #RecursionExplained #CodingJourney #Programming101 #TechTalks #AlgorithmMastery #Recursion #Programming #Algorithm #Code #ComputerScience #SoftwareDevelopment #CodingTips #RecursiveFunctions #TechExplained #ProgrammingConcepts #CodeTutorial #LearnToCode #TechEducation #DeveloperCommunity #RecursiveThinking #ProgrammingLogic #ProblemSolving #AlgorithmDesign #CSEducation




Other Videos By codestorywithMIK


2024-02-13Rearrange Array Elements by Sign | 2 Approaches | Why Order Preserve | Leetcode 2149
2024-02-13Quick Sort | Simple Story | Story To Code | Recursion Concepts And Questions | Video 9
2024-02-12Find First Palindromic String in the Array | Multiple Ways | Leetcode 2108
2024-02-11Cherry Pickup II | 3 Approaches | Super Detailed | Leetcode 1463
2024-02-10Tumlog saath ho. Bas kaafi hai ❀️ 18K family #codestorywithmik
2024-02-09Palindromic Substrings | Blueprint | Palindrome Problems | 4 Approaches | Leetcode 647
2024-02-08Largest Divisible Subset | LIS Variant | DP Concepts & Qns-18 | Leetcode-368
2024-02-08Merge Sort | Simple Story | Story To Code | Recursion Concepts And Questions | Video 8
2024-02-07Perfect Squares | Bottom UP | Made Easy | Google | Leetcode 279
2024-02-07Minimum Time to Revert Word to Initial State | Part I | Part II | KMP | Leetcode 3029 | 3031
2024-02-06Tower Of Hanoi | Simple Story | Story To Code | Recursion Concepts And Questions | Video 7
2024-02-06Count the nodes at distance K from leaf | 2 Approaches | Simple Dry Run | GFG POTD
2024-02-05Tail Recursion | Tail call Optimisation | Examples | Recursion Concepts And Questions | Video 5
2024-02-05Time Complexity | Space Complexity | Examples | Recursion Concepts And Questions | Video 4
2024-02-05Recursion Tree | Call Stack | Recursion Concepts And Questions | Video 3
2024-02-05Recursion Leap Of Faith | Examples | Recursion Concepts And Questions | Video 2
2024-02-05Introduction | Recursion Concepts And Questions | Video 1
2024-02-04First Unique Character in a String | Easy | Leetcode 387
2024-02-03Every trip teaches me something. #codestorywithmik
2024-02-02Partition Array for Maximum Sum | Why DP | Recursion | Memo | Bottom Up | Leetcode 1043
2024-02-02Sequential Digits | 2 Approaches | Leetcode 1291