Search A Maze For Any Path - Depth First Search Fundamentals (Similar To "The Maze" on Leetcode)

  Рет қаралды 160,301

Back To Back SWE

Back To Back SWE

Күн бұрын

Пікірлер: 332
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Table of Contents: Leave The Library Plz 0:00 - 0:17 The Problem Introduction 0:17 - 2:50 Our Fundamental Operations 2:50 - 3:50 Beginning The Depth-First Search 3:50 - 7:26 We Hit Dead End #1 7:26 - 9:50 We Get Back On Track 9:50 - 12:03 We Hit Dead End #2 12:03 - 13:27 We Get Back On Track Again 13:27 - 14:31 We Reach Our Target: The End 14:31 - 15:00 Returning Back Upwards With The Path 15:00 - 15:28 The Top Level Caller Gets The Path 15:28 - 15:59 Time Complexity 15:59 - 16:42 Space Complexity 16:42 - 17:09 Wrap Up 17:09 - 17:30 The code for this problem is in the description. Fully commented for teaching purposes.
@amirmohideen99
@amirmohideen99 4 жыл бұрын
code is missing
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The repository is deprecated - we only maintain backtobackswe.com now
@punitpawar4231
@punitpawar4231 4 жыл бұрын
@@BackToBackSWE Is it possible for you to share the link to this code ?
@Thadnill
@Thadnill 4 жыл бұрын
@@punitpawar4231 I wonder this as well
@UECDishaKhattri
@UECDishaKhattri 4 жыл бұрын
yes it would be wonderful if you just provide the code link
@frogspawn8
@frogspawn8 5 жыл бұрын
Bruh, your lectures are WAY clearer and more concise than some of the “best” professors I’ve encountered. Kudos to you!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thx
@ers-br
@ers-br 2 жыл бұрын
I thought he was a professor ... and he's just a student. Really good explanations.
@FrancoMunizAR
@FrancoMunizAR 4 жыл бұрын
You and Abdul Bari are the kings of explaining algorithms and problem solving. Thanks a LOT for everything you do!
@johnbanyan11
@johnbanyan11 3 жыл бұрын
Damn true
@jst8922
@jst8922 4 ай бұрын
NeetCode, DEEPTI TALESRA, Jenny's Lectures CS IT, Tushar Roy - Coding Made Simple, Nikhil Lohia too.
@lmnefg121
@lmnefg121 4 жыл бұрын
I really like that you explain things in such a simple way and teaches the most fundamental method. As a matter of fact, it is always most difficult to learn the most fundamental stuff.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks.
@betatester03
@betatester03 4 жыл бұрын
Man, you are an excellent teacher. I stumbled onto one of your videos earlier and immediately started up another, right after. I'm about five videos in, now. I've got books upon books about algorithms, I've read articles, related papers, tutorials, pseudo-code implementations, and public code-bases on software repo's, but this is the first time I've gained a simple, clear intuition for some of these concepts. Thank you so much for taking the time to make these videos. I'll refer people to your content any chance I get.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Sure - thank you.
@TJ-rf1xl
@TJ-rf1xl 5 жыл бұрын
Best explanation I've seen of DFS so far. I wish my professors explained things this way. I likely would have dropped out of my MSc if it wasn't for your channel!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
dang, nice!
@GraniLP
@GraniLP 3 жыл бұрын
Big thanks to you! Currently I am a bit angry that my university is not capable of explaining such stuff in a nice way, but you did it in less time and in a much clearer way!
@sindisiwemncube4665
@sindisiwemncube4665 2 жыл бұрын
This dude is a brilliant tutor. Never have i ever understood an algorithm this clearly, Juss did.
@abyssking4062
@abyssking4062 3 жыл бұрын
Till now, your video is still saving lives. I finally completed my damn maze assignment after your explanation. Wherever you are bro, THANK YOU!!!
@qiuyangshen3569
@qiuyangshen3569 4 жыл бұрын
The call stack is a state! So brilliant words!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@deepusasidharan2012
@deepusasidharan2012 3 жыл бұрын
Yes...it cud be completed or uncompleted(waiting for child stack to complete)
@ceek79
@ceek79 5 жыл бұрын
Honestly, you sitting in front of a computer would be a waste of talent! Take advantage of your skill to explain complex stuff the easy way and make a business out of it.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
👀👀💰💸💰
@jonathandaniel7321
@jonathandaniel7321 5 жыл бұрын
@@BackToBackSWE start a university with only you as teacher
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@jonathandaniel7321 I do not want to do that.
@Dunig2
@Dunig2 4 жыл бұрын
This is so clear to me, I’m amazed at how easy you make this to understand
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@sairamankilambi5007
@sairamankilambi5007 4 жыл бұрын
I saw the BFS & DFS (15 min) video followed by the maze problem. Wow! It clears out when and where to chose BFS over DFS. Thanks a LOT!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@ravitanwar9537
@ravitanwar9537 5 жыл бұрын
hey man , i'm the one who asked for minimum window substring on leetcode . just wanna tell you that you doing a pretty good job and this channel HAS the potential. keep coming up with these videos and if possible with python language . cheers!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hmmmm, yeah, good idea. I need to brush up on my Python though. My languages in order of strength: Java, Typescript (a superset of course), Javascript ...then some experience with C, C#, Ruby
@ravitanwar9537
@ravitanwar9537 5 жыл бұрын
@@BackToBackSWE n i think it'll also be a good idea if you specify the difficulty level before the video . for eg :- easy , medium , hard on leetcode ,
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@ravitanwar9537 Every video has badges of the difficulty.
@darkhorse621
@darkhorse621 4 жыл бұрын
Best Explanation for DFS I've come across so far. Thanks a lot !!! Keep up the good work guys.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@thatolebethe8896
@thatolebethe8896 2 жыл бұрын
Dude thanks for thee constant repition. Really helped cement how depth first search works
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Glad to hear that! explore our 5 day free mini course for some cool content - backtobackswe.com/
@psn999100
@psn999100 5 жыл бұрын
WOW. best explanation so far. After this I am gonna do Maze I, II and III on Leetcode. I got asked this for Amazon OA and i screwed up cuz my fundamentals were not good. thanks
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice and sure
@Hav0c1000
@Hav0c1000 4 жыл бұрын
Hey man, after listening to your excellent explanation, I was able to go and code this up! Thanks! You are a really good teacher!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@darod6098
@darod6098 5 жыл бұрын
Just amazing. I'm really grateful for your work
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
long way to go...very very very very long way
@xxbighotshotxx
@xxbighotshotxx 5 жыл бұрын
@@BackToBackSWE Don't forget to enjoy the journey :)
@PJ-hi1gz
@PJ-hi1gz 3 ай бұрын
bro you explain so clear, it's a wonderful gift to have and share with others
@shubhamk840
@shubhamk840 4 жыл бұрын
you have an amazing skill of teaching, even 10 years old can understand your explanation.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@erinkerciku
@erinkerciku 2 жыл бұрын
I don't usually leave likes on videos but you deserve it my guy.
@kgopotsomasela4627
@kgopotsomasela4627 2 жыл бұрын
Your patience is admirable
@alikizander
@alikizander Жыл бұрын
Your delivery and presentation is just on POINT. I don't like it, I LOVE IT. You helped me tackle a PACMAN PROBLEM USING THE UNIFORM-COST SEARCH BY JUST WATCHING THIS VIDEO
@sanctusfides
@sanctusfides 2 жыл бұрын
"Can I go up, yes I can!" is going to be looping in my head for a week after this video
@maharshidave4472
@maharshidave4472 5 жыл бұрын
Hello, sir you have high degree of patience to expain each and every minute detail. And I wish you will soon reach your traget of 100K subscribers and keep it up.😀
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thx
@banelemakhanya2595
@banelemakhanya2595 Жыл бұрын
​@@BackToBackSWE hi, would love help on mazes
@ritwik121
@ritwik121 4 жыл бұрын
the visualizations are really fantastic. awesome work ben :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@stephentanksleymusic7240
@stephentanksleymusic7240 4 жыл бұрын
This was fantastic. Thank you so much for such a clear, effective explanation of recursive DFS algorithms for maze traversal!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure!
@ebiigweze3384
@ebiigweze3384 4 жыл бұрын
"AND NOW WE ARE THIS CELL" ........that is a drinking game right there...number of times that was said, man would be wasted in no time...cool tutorial bro .. keep it up
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hahahahahahaha
@vrdash
@vrdash 4 жыл бұрын
The video goes in-Depth of the topic literally and thus my search for DFS is complete :p
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@pavel9652
@pavel9652 5 жыл бұрын
This is the library floor plan. The library will be closing in 15 minutes. Implement one of the fundamental graph searching algorithms (DFS/BFS) to find the exit from the building ;)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
yes
@siddhantrai7529
@siddhantrai7529 5 жыл бұрын
One of the best explanation of maze problem... Beautiful
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@jkim5118
@jkim5118 5 жыл бұрын
What's the main pros and cons of doing this in BFS and DFS? I thought DFS would be better, but it seems like only BFS is accepted on Leetcode. What are your thoughts? Also, do you think we should also know how to do Dijkstra for these kinds of search questions but with weights?
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
BFS always finds the shortest path. The reason DFS times out is because it will get really far from the answer and waste time. BFS will find the object faster...generally...think about it...BFS goes out level by level and doesn't go deep into anything. This is good and bad. Ponder on these things.
@zackgrey4472
@zackgrey4472 4 жыл бұрын
Beautiful video, you just earned a subscriber. I really admire your content!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@goldfishbrainjohn2462
@goldfishbrainjohn2462 4 жыл бұрын
This helped me a lot!! I love the way you teach. Thanks. Subscribed immediately Edit: The code below is my version of DFS for a maze problem and the concept is based on this video. Appreciate it. function solve(lines) { let wAndH = lines.shift(); wAndH = wAndH.split(' '); let [w, h] = wAndH; w = Number(w); h = Number(h); let nestedArr = lines.map(item => { let a = []; a.push(item); return a; }) nestedArr = nestedArr.map(item => { return item[0].split(""); }) let blockStart = []; let blockEnd = []; for(let i = 0; i < w; i++){ blockStart.push('#'); blockEnd.push('#'); } nestedArr.splice(0, 0, blockStart) nestedArr.splice(h+1, 0, blockEnd); nestedArr.forEach(item => { item.unshift('#'); item.push('#'); }) let roadCoordinates = []; function findRoad(arr = [], h = 0, w = 0, road) { const checkUp = (arr, h, w) => { if(arr[h-1][w] === '.') { return true; } else { return false; } } const checkRight = (arr, h, w) => { if(arr[h][w+1] === '.') { return true; } else { return false; } } const checkDown = (arr, h, w) => { if(arr[h+1][w] === '.') { return true; } else { return false; } } const checkLeft = (arr, h, w) => { if(arr[h][w-1] === '.') { return true; } else { return false; } } if(arr[h] != 'undefined') { if(arr[h][w] === '.') { if(checkUp(arr, h, w)) { arr[h][w] = '1'; road.push([w,h]) findRoad(arr, h-1, w, road); } else if(checkRight(arr, h, w)) { arr[h][w] = '1' road.push([w,h]) findRoad(arr, h, w+1, road); } else if(checkDown(arr, h, w)) { arr[h][w] = '1' road.push([w,h]) findRoad(arr, h+1, w, road); } else if(checkLeft(arr, h, w)) { arr[h][w] = '1' road.push([w,h]) findRoad(arr, h, w-1, road); } else if(arr[h][w] === '.') { arr[h][w] ='1'; road.push([w,h]) } } else { console.log('Wrong') } } } findRoad(nestedArr, 1, 1, roadCoordinates) nestedArr.pop(); nestedArr.shift() nestedArr.forEach(item => { item.pop(); item.shift() }) roadCoordinates.pop(); console.log(roadCoordinates.length) }
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great, thanks, sure, and great
@adityamohan393
@adityamohan393 4 жыл бұрын
Amazing explanation, but not able to find the code in the description.
@ryangallagher1285
@ryangallagher1285 2 жыл бұрын
The best explanation on the internet.
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
That's nice of you
@erichlf
@erichlf 5 жыл бұрын
Amazon asked me this in the phone interview and even though I knew it I promptly fucked it up.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Eh, whateves
@wrestlingscience
@wrestlingscience 3 жыл бұрын
absolutely no one: backtobackswe: can i go up yes can i go up yes can i go up no
@HemanthaKumarYadav
@HemanthaKumarYadav 4 жыл бұрын
The way you explain is simply amazing sir!
@studyonline3236
@studyonline3236 4 жыл бұрын
client, at the end of a successful dfs, to node at the start: Yo got the result? start node : yes client: What did it cost? node: realisation at 9:50 and 13:31
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
wut lol
@无名字-q7k
@无名字-q7k 3 жыл бұрын
Thanks! this is useful, im currently making a game which npc will randomly trigger travel event, but i need the npc to calculate the clear path to the end and avoid crash into rock and hill 😂
@leelavathisettu2762
@leelavathisettu2762 3 жыл бұрын
Where is the code for the DFS approach
@anssha2643
@anssha2643 4 жыл бұрын
Best explanation of DFS. Thanks a lot. God bless you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@ShikharKumar-fz6ti
@ShikharKumar-fz6ti 21 күн бұрын
Amazing video, do you have one of these Maze path for BFS, A*, Uniform Cost Search?
@kirillzlobin7135
@kirillzlobin7135 Жыл бұрын
Maaan, you are the legend. Thank you for your brilliant explanation!!!
@BackToBackSWE
@BackToBackSWE Жыл бұрын
Happy Halloween 🎃 Thank you from one legend to another, kirillzlobin! You get some extraaa treats - 50% Off our exclusive lifetime membership use the code SPOOKY50 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=SPOOKY50
@umairbijapure7584
@umairbijapure7584 3 жыл бұрын
U hv given a greatest explanation i ever had on KZbin..but implementation is also important right..plz do explain codes as well
@lifecodesher5818
@lifecodesher5818 4 жыл бұрын
this man is international version of sumeet sir of pepcoding
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
what lol
@fmpwizard
@fmpwizard 2 жыл бұрын
Awesome explanation! Very clear and the right amount of details
@jefferyxie3248
@jefferyxie3248 3 жыл бұрын
Thanks so much for the video! This makes so much more sense now
@multichannellk1966
@multichannellk1966 4 жыл бұрын
Where is the solution code please give me the link
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The respository is deprecated - we only maintain backtobackswe.com now.
@andyhujian
@andyhujian 4 жыл бұрын
Good talk. But it's different from maze leetcode. In leetcode problem, it can't choose directions at will. It needs to hit a wall before making a turn.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@santasingh9045
@santasingh9045 4 жыл бұрын
take a bow,man!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
bow
@julianbullmagic
@julianbullmagic 4 жыл бұрын
keep posting videos, I would love to see more of this
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok will do
@mariasandru7
@mariasandru7 5 жыл бұрын
What if we wanted to search for all the possible paths? I am talking about the Unique Paths III problem on Leetcode. Amazing video btw!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
We can just do a DFS and imagine this as a tree. The "leaf" is the end, we keep track of the path up to the end then add it as an answer, then backtrack, and if we reach the end again we again register the different way we got there.
@mariasandru7
@mariasandru7 5 жыл бұрын
@@BackToBackSWE Thank you! I got accepted from the first submission:D
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@mariasandru7 nice
@richardaguilar7692
@richardaguilar7692 4 жыл бұрын
Thank you so much for this! Very clear and concise explanation of DFS.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@aliceabejo8044
@aliceabejo8044 3 жыл бұрын
What the decimals please?
@Yusifinify
@Yusifinify 3 жыл бұрын
Brilliant - clear and concise!
@ramraut180
@ramraut180 5 жыл бұрын
The great video. Thank you so much for your contribution. Keep continuing making this type of video. Thumbs up !
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@toyadavrahul
@toyadavrahul 5 жыл бұрын
Great Explanation!! would be better with some pseudo code!! Else found it really helpful. Thanks!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@267praveen
@267praveen 3 жыл бұрын
Ques - why we didn't chose BFS here? And what was the reason behind chosing DFS? You did mention that BFS gives shortest path but then switched to DFS. Can you please shed some more light?
@manurajput5348
@manurajput5348 3 жыл бұрын
Hey can you explain why the time complexity is V+E. We are checking 4 (i.e. E) edges for each vertices(V). So shouldn't the complexity be 4V i.e. V.E?
@svdfxd
@svdfxd 5 жыл бұрын
Awesome explanation. Keep up the good work. Do you have a concise list of Algorithms that we must study? I have gone through udemy courses but there are many many algorithms. It would be good if there is a list which lists all important algorithms.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
For interviews or to become a great computer scientist? For interviews check this readme: github.com/bephrem1/backtobackswe To become a great computer scientist I'm not totally sure. There is too much to cover here in one comment.
@svdfxd
@svdfxd 5 жыл бұрын
For the interviews :). Thanks a lot.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@svdfxd Yeah, read EPI. Watch all Hacker Rank videos on KZbin. And....watch my videos in the coming months :)
@lawlietnao_music
@lawlietnao_music 5 жыл бұрын
dude I hecking love you, if I get the offer I'll definitely donate the shit out of u
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Don't, just get the offer.
@zackzayco9135
@zackzayco9135 3 жыл бұрын
Great information 💪🏽💯 I appreciate it
@atmafra1971
@atmafra1971 Ай бұрын
Very helpful, thanks a lot!
@promamukherjee5874
@promamukherjee5874 3 жыл бұрын
If I'm not mistaken, this approach is backtracking, right? And its complexity is to the exponential order of 2^(n*m) where n*m is the order of the matrix, but for a vanilla DFS we should have linear complexity, O(m*n)
@kyawn5115
@kyawn5115 4 жыл бұрын
Great content! Keep up the good work!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@akhilk5121
@akhilk5121 4 жыл бұрын
I am confused. You said in your bfs,dfs fundamentals that bfs can be used to check "if a path exist" . Here you said bfs is going to give the shortest path so its better to use dfs to find "if a path exist". What did i miss?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Both can be used for path search
@MdMainuddinJU
@MdMainuddinJU 3 жыл бұрын
Subscribed the channel, Liked the video, it deserves it.
@jonaurz
@jonaurz 4 жыл бұрын
you explained so well, thank you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@exkorbuto1
@exkorbuto1 5 жыл бұрын
Well, I had a similar problem but there can be too many paths, that adds complexity. And I had to choose the shortest.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@sidb8066
@sidb8066 4 жыл бұрын
Hey! Great video! What;s the difference between DFS and Backtracking on this problem? Cant both be used and wont both work the same way?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
DFS is a search methodology. Backtracking entails looking at candidate solutions in an exhaustive way (often following a search path) and "backtracking" to abandon partial solutions once they can't lead to a final solution. Both can happen at the same time. Example: "Search a graph for paths from the start to the end with cost < 100, no nodes have a negative cost." If I am on a path and my cost hits 140 I could be deep into a path (if I am using DFS) but I'd backtrack to the previous node I was at since I can't recover (i shouldn't have stepped on the next node in the first place but you get the idea).
@martinharris4416
@martinharris4416 4 жыл бұрын
OMG YOU'RE SOOO DEEEEP
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@rizzbod
@rizzbod Жыл бұрын
this is amazingly amazing explanation. thnx buddy
@jeffreyslominsky7656
@jeffreyslominsky7656 4 жыл бұрын
Thank you, your explanations are great!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure and thanks
@drizle9231
@drizle9231 4 жыл бұрын
That was a very clear explaination.Keep it up ! 😊
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@chrisliu5403
@chrisliu5403 5 жыл бұрын
appreciate it man, well explained.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@adrizamishra7568
@adrizamishra7568 3 жыл бұрын
Thank you for saving us!
@althafa8371
@althafa8371 5 жыл бұрын
atlast i found non indian tutorial :P , good explanation bro
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
ye, indians r brothers tho
@dinner4chiahao
@dinner4chiahao Жыл бұрын
Your vids are brilliant.
@nanamahmoud147
@nanamahmoud147 4 жыл бұрын
I want to ask how did you decide the order of the operations "up","right","left",down" , is it because you compared the starting cell and the goal/end cell and found out you should prioritize "up" and "right" operations ? so thats why they are at the top of the order of the operations and you check on them first?
@nanamahmoud147
@nanamahmoud147 4 жыл бұрын
and can you please provide me the of the code that corresponds to this problem
@niddynoddy
@niddynoddy 4 жыл бұрын
I'm currently having a problem with implementing DFS in ruby, and have had it for a week now. Is there a way to get the code out of this video anymore?
@rubaiyathussain3124
@rubaiyathussain3124 5 жыл бұрын
Thank you. i fully grasp it.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@Thadnill
@Thadnill 4 жыл бұрын
If I want to use the DFS to generate a maze in C++, and not necessarily solve it, how should I think and start out? Thanks for the great video!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure and you can google that?
@maxinteltech3321
@maxinteltech3321 3 жыл бұрын
Awesome explanation
@shathamaayouf6048
@shathamaayouf6048 5 жыл бұрын
I need you to switch positions with my German lecturer
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hahahaha
@rishabhmalhotra2225
@rishabhmalhotra2225 4 жыл бұрын
Can you explain how to represent the maze in the form of a graph?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
cell is a node, edges are the 4 adjacent walls
@Thadnill
@Thadnill 4 жыл бұрын
Woa, you just got my sub! P.S do you have the code available? I can't find it
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Thanks, and the code repository is deprecated - we only maintain backtobackswe.com now.
@gk79797
@gk79797 4 жыл бұрын
Awesome explanation sir!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@deepusasidharan2012
@deepusasidharan2012 3 жыл бұрын
Great Visulazation material....Please draw a small CallStack as well.....
@alanye7542
@alanye7542 2 жыл бұрын
So amazing! Thanks!
@dongshuowu3454
@dongshuowu3454 5 жыл бұрын
Amazing as usual.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks haha
@algorithmimplementer415
@algorithmimplementer415 5 жыл бұрын
May I ask, if you are given an adjacency matrix of m x m, in that case what would be the time complexity of DFS path finding algorithm? Could you also explain?
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Sure, this search should give you what you need: www.google.com/search?q=DFS+with+adjacency+matrix+time+complexity&oq=DFS+with+adjacency+matrix+time+complexity&aqs=chrome..69i57j0l5.7645j1j7&sourceid=chrome&ie=UTF-8
@parthsohani2429
@parthsohani2429 4 жыл бұрын
When should we go for bfs for such maze problems? Other way round, when should we go for dfs for such maze problems?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
bfs - wide, shortest path dfs - deep, any path finding
@asifulhaque4026
@asifulhaque4026 Жыл бұрын
Best explanation🖤
@prodbyCheez
@prodbyCheez 2 жыл бұрын
and now we are at this cell
@shikharsaxena4432
@shikharsaxena4432 4 жыл бұрын
At one point in this video, I was wondering whether Canwegoup is a word.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lol what
@greaper3180
@greaper3180 3 жыл бұрын
I wish you were my teacher in university.
@jupaol
@jupaol 4 жыл бұрын
Can anyone share the code? I was not able to find it in the description
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The repository is deprecated - we only maintain backtobackswe.com now.
@shivams417
@shivams417 4 жыл бұрын
clear explanation
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
The hidden beauty of the A* algorithm
19:22
Polylog
Рет қаралды 900 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
Breadth First Search grid shortest path | Graph Theory
16:51
WilliamFiset
Рет қаралды 339 М.
Breadth First Search (BFS): Visualized and Explained
10:41
Reducible
Рет қаралды 221 М.
Top 5 Most Common Graph Algorithms for Coding Interviews
13:01
Uninformed Search via Depth-First Search: Keep Pushing Onward
10:34
Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction
29:31
Back To Back SWE
Рет қаралды 51 М.
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Рет қаралды 1,3 МЛН