Рет қаралды 44,530
To see more videos like this, you can buy me a coffee: www.buymeacoffee.com/studyalg...
A very famous backtracking problem. Given an array of unique elements, find all the possible permutations. This video shows how to identify the logic which creates all different permutations. Once we know how to find permutations, we can map it to the backtracking algorithmic paradigm. The concept is super simplified using diagrams and visuals of state space tree. You will also find a dry-run of the code in JAVA.
The actual problem on LeetCode: leetcode.com/problems/permuta...
Chapters:
00:00 - Intro
01:13 - Understanding the problem
02:51 - Logic to find permutations
06:43 - Using Backtracking to find permutations
11:52 - Dry-run of Code
15:36 - Final Thoughts
📚 Links to topics I talk about in the video:
Brute Force Paradigm: • Brute Force algorithms...
Backtracking: • Backtracking made easy...
Similar problem (Subsets): • Subsets (LeetCode 78) ...
Other problems on LeetCode: • Leetcode Solutions
📘 A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
Test-cases on Github: github.com/nikoo28/java-solut...
📖 Reference Books:
Starting Learn to Code: amzn.to/36pU0JO
Favorite book to understand algorithms: amzn.to/39w3YLS
Favorite book for data structures: amzn.to/3oAVBTk
Get started for interview preparation: amzn.to/39ysbkJ
🎥 My Recording Gear:
Recording Light: amzn.to/3pAqh8O
Microphone: amzn.to/2MCX7qU
Recording Camera: amzn.to/3alg9Ky
Tablet to sketch and draw: amzn.to/3pM6Bi4
Surface Pen: amzn.to/3pv6tTs
Laptop to edit videos: amzn.to/2LYpMqn
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Follow on Twitter at: / studyalgorithms
Follow on Tumblr at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #backtracking #interview