Recursive Backtracking - DSA Course in Python Lecture 14

  Рет қаралды 16,619

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 21
@GregHogg
@GregHogg 5 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@Alex-tm5hr
@Alex-tm5hr 2 ай бұрын
I appreciate you making the vid greg! vids that explain a concept/algo and then show an example are very useful, not many people doing that
@asagiai4965
@asagiai4965 5 ай бұрын
Nice. Explanation. I might have a question but I still have to think about it.
@chinmayjoshi2495
@chinmayjoshi2495 2 ай бұрын
5:52 he better call 'sol'
@ojxchaos
@ojxchaos 2 ай бұрын
This solution is brilliant
@ceciljoel9577
@ceciljoel9577 5 ай бұрын
this problem came in my coding interview but instead i had to just output the number of subset so i just printed 2 to power n
@teostorm1
@teostorm1 3 ай бұрын
I don't think anyone could explain this better fr
@harshgamer6105
@harshgamer6105 5 ай бұрын
7:40 , so basically, we are doing inorder traversal right?
@study-me1oe
@study-me1oe 4 ай бұрын
Yup
@ClipGossip
@ClipGossip Ай бұрын
i think the time complexity should be 2^n * n right ?
@devoch2031
@devoch2031 Ай бұрын
Total number nodes in the tree = (2^0+2^1+...+2^n) = 2^(n+1) - 1. So, Time complexity is O(2^n).
@pianolessonswithbless879
@pianolessonswithbless879 2 ай бұрын
You said youve covered videos om DFS but I went through your playlist and didn't see it, please can you send me the link
@aakashs1806
@aakashs1806 5 ай бұрын
Very hard
@biavechiato
@biavechiato Ай бұрын
Nobody got me like Greg Hogg got me
@aryanpratap5853
@aryanpratap5853 5 ай бұрын
First view 😊😊
@gibs40
@gibs40 5 ай бұрын
Hardest sht in coding
@GregHogg
@GregHogg 5 ай бұрын
Yeah it probably is
@andrewtitus6839
@andrewtitus6839 3 ай бұрын
Glad it's not just me who has had trouble understanding recursion. But it's a good building block for understanding harder problems, like ones involving dynamic programming.
@barthsparks9791
@barthsparks9791 3 ай бұрын
I tried this, and it didn't even work.
@JoatXI
@JoatXI 2 ай бұрын
if you tried it in leetcode and it didn't work, make sure your coding language is Python3 and not just "Python"
@xingyuxiang1637
@xingyuxiang1637 2 ай бұрын
@@JoatXI He probably means conceptually. I would say let the idea about selecting and unselecting be clear in the arguments or function calls. So, in this branch, it is selected. In the other branch, it is unselected. Then, there are fewer global variables to keep track of. Greg's approach is like backtracking for 1-tree or reversing a single-linked list by recursions that can be done easily through combinations API or reversing API. One is probably working on advanced skill sets if one is using this approach. However, global or nonlocal keywords are discouraged at the moment. There are indeed many hard problems. So, one just needs to be very patient to go through the code step by step or purchase a premium to use the debug feature. In my case, I would work on beginner problems mostly.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,3 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Permutations - Leetcode 46 - Recursive Backtracking (Python)
9:42
The Backtracking Blueprint: The Legendary 3 Keys To Backtracking Algorithms
13:44
Backtracking (Think Like a Programmer)
13:02
V. Anton Spraul
Рет қаралды 345 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 663 М.
Recursion in Programming - Full Course
1:51:36
freeCodeCamp.org
Рет қаралды 974 М.
Algorithms Explained for Beginners - How I Wish I Was Taught
17:38
Internet Made Coder
Рет қаралды 377 М.
COMPUTER SCIENCE explained in 17 Minutes
16:49
Wacky Science
Рет қаралды 1,6 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН