Backtracking - Rat in a Maze | C++ Placement Course | Lecture 18.1

  Рет қаралды 314,593

Apna College

Apna College

Күн бұрын

Пікірлер: 509
@bdbrightdiamond
@bdbrightdiamond 3 жыл бұрын
00:53 stamina OP😂❤️
@Zartan-XR
@Zartan-XR 3 жыл бұрын
🤣🤣Bade Harami Ho Beta
@bdbrightdiamond
@bdbrightdiamond 3 жыл бұрын
@@Zartan-XR 😂😂😂😂
@cenacr007
@cenacr007 3 жыл бұрын
indeed
@vaneetkapoor427
@vaneetkapoor427 3 жыл бұрын
😂😂😂😂
@sparshgupta9900
@sparshgupta9900 3 жыл бұрын
Jada sochgya londa😂😂..
@funland739
@funland739 3 жыл бұрын
Backtracking : Pahele istamal kare fir vishavas kare 😂👍
@navya9914
@navya9914 3 жыл бұрын
Hahaha really funny😂😂
@johnwick-m4m
@johnwick-m4m 3 жыл бұрын
LOL
@jatingupta1866
@jatingupta1866 3 жыл бұрын
its simply means undo
@aryanrodrigo7574
@aryanrodrigo7574 3 жыл бұрын
i guess Im asking randomly but does someone know a method to get back into an instagram account..? I stupidly lost the password. I would love any tricks you can give me
@skylerelian2448
@skylerelian2448 3 жыл бұрын
@Aryan Rodrigo instablaster :)
@a.....9053
@a.....9053 3 жыл бұрын
He is only person who had work very hard for indian youth let support him together pls share this video so more youth can utilise sources
@udaykadam5455
@udaykadam5455 3 жыл бұрын
"only" !!!?
@a.....9053
@a.....9053 3 жыл бұрын
@@udaykadam5455 physics wallah is also best
@AnkitKumar-nx2tq
@AnkitKumar-nx2tq 3 жыл бұрын
@@a.....9053yes..but aman's content is much more diverse
@AvikNayak_
@AvikNayak_ 3 жыл бұрын
He is not the only one.
@indraxios
@indraxios 3 жыл бұрын
If you search c++ this is the first thing you'll see No need to share
@jayeshyadav07
@jayeshyadav07 3 жыл бұрын
1:47 👍👍👍 urvi dii op👍👍👍11:32. Watch last 17:50 to 18:27 . You will definitely smile. 👍 Thanks 😊 Aman bhaiya.
@dipeshsaili4468
@dipeshsaili4468 3 жыл бұрын
pgle pyaar hogya kya tereko?
@7_ajinkya
@7_ajinkya 3 жыл бұрын
Wow! It means "leap year" code has a simple backtracking logic! Cool!! I didn't even knew I was using backtracking for so long😂😂😂
@pradnyeshmate1317
@pradnyeshmate1317 Жыл бұрын
i don't get what you are saying which leap year code
@singh_lki
@singh_lki 3 жыл бұрын
02:03 Jab neha hi akeli bachi to constraints change kar liye honge rahul ne 😂
@VC-dm7jp
@VC-dm7jp 3 жыл бұрын
Finally learnt how to pass a 2 array without mentioning the number of columns!! And a really good video to understand the concept of backtracking.
@jaypratap3888
@jaypratap3888 3 жыл бұрын
What happens if there are multiple paths through which rat can reach the destination. I guess it will take the first path and neglect all other paths , Correct me if I am wrong.
@sourabhchoudhary7289
@sourabhchoudhary7289 3 жыл бұрын
Backtracking -- Sab try kro fir sahi chuno!
@neerajkrishnan8574
@neerajkrishnan8574 3 жыл бұрын
In a nutshell ghadi detergent
@sourabhchoudhary7289
@sourabhchoudhary7289 3 жыл бұрын
@@neerajkrishnan8574 😂
@kumarakash5219
@kumarakash5219 3 жыл бұрын
@@neerajkrishnan8574 airtel sahi example hoga
@sushmapandey7145
@sushmapandey7145 3 жыл бұрын
Pehle istemaal karein phir vishwaas krein
@bboynishant5255
@bboynishant5255 Жыл бұрын
Nhi nhi pehle try kro aur Lage ki red flags hai toh agey padho he mat, wapas bhaago
@joyboy1088
@joyboy1088 3 жыл бұрын
Damn, they really are putting out some good stuff !!! I had to refer to gfg and other videos to study these topics for competitive coding, gonna watch them again in case I missed something
@Callme-DS
@Callme-DS 3 жыл бұрын
didi aap na pura code likhne ke baad ek baar fir se line by line samjha diya kro kyuki ek saath jaldi samajh me aa jata hai
@talhashahid3677
@talhashahid3677 2 жыл бұрын
Nice lacture today I understand complete rat in maza problem without any doubt ☺
@anjulatakashyap6974
@anjulatakashyap6974 3 жыл бұрын
Mam your voice is so sweet, and also your teaching style is awsome😍, thank you so much for provide this type of content in free of cost .
@aakankshanidhi4989
@aakankshanidhi4989 3 жыл бұрын
yeah her voice is magical
@muhammadsaifullah3078
@muhammadsaifullah3078 2 жыл бұрын
this video really helps me, before that I have watched 3 videos on backtracking This really helps
@yashsimra6090
@yashsimra6090 3 жыл бұрын
please mam make a seperate video on dynamic memory allocation in detail with example
@kunalgautam8312
@kunalgautam8312 3 жыл бұрын
I recently started DSA for placement and chose this series. I was thinking the problem will be hard, etc. before watching the video. But you explained it very clearly and easily. Thank you!
@l_am_Ahashan
@l_am_Ahashan Жыл бұрын
Way of explaining Osam ma'am
@amlansaikia652
@amlansaikia652 3 жыл бұрын
This question was really interesting.
@rajaryanbiswas5486
@rajaryanbiswas5486 Ай бұрын
Best explanation ever didi
@AbhishekSingh-eo6bi
@AbhishekSingh-eo6bi 3 жыл бұрын
Me at 11:32 -: Ye Choti Choti khusi har koi nhi deta mere payare ...... In all her video understanding & andar wali khusi ( samjh rahe ho 😜 ) is 💯🔥🤟🏻
@subhashkumar-rl4nf
@subhashkumar-rl4nf Ай бұрын
all the content on this channel is correct and ,and meant especilly for placement do shrare the video and encourage her to made lot more video likes this .
@playpoint5792
@playpoint5792 3 жыл бұрын
Art : Aman Dhattarwal Artist : Aman Dhattarwal's team Such a good course wasn't possible without DiDi.
@vibhanshusharma5974
@vibhanshusharma5974 3 жыл бұрын
kabhi samaj nhi aya yeh topic lekin aaj poora clear ho gya thanxs aap sbko best of luck
@success_hub93
@success_hub93 3 жыл бұрын
I don't know why but i am addicted to her voice... Never feel bored 😍
@aakankshanidhi4989
@aakankshanidhi4989 3 жыл бұрын
same here
@tanishafre4492
@tanishafre4492 3 жыл бұрын
Ye ladka ketchup se judge kar raha he bhaiiii... I want this level of confidence!!!
@Saurabh-gg9lv
@Saurabh-gg9lv 3 жыл бұрын
question was really amazing
@rahulPandey-xt2ww
@rahulPandey-xt2ww Жыл бұрын
bhtt achha feel huaa soch k
@rutvikrana512
@rutvikrana512 3 жыл бұрын
Important Points :- - Same Problem Can Be Solved By Dynamic Programming Because Rat can move only right and down. Read Dynamic Programming From Books If You Are New To It. - Common Syntax Of Any Backtraking code :- bool recur(){ if(){} else(){} ..........Terminating Conditions if( we achieved goal ){ return true; } for( Check every directions ){ old_var = new_var; .........change single point if( recur() ){ return true; } .............check if we are right about this point. new_var = old_var; ..............no this point failed reverse changes and loop continue. } return false; ...........if we cant find any direction to go return false; } - If You Understand Fine and Feel Confident then check Sudoku Solving Problem which is also Backtraking problem. HAPPY LEARNING :)
@kunal9748
@kunal9748 3 жыл бұрын
hey, can you please share some book name related to algorithms
@rutvikrana512
@rutvikrana512 3 жыл бұрын
@@kunal9748 ... Groking’s algorithm is best for basics, then read from online sources, GFG, totorialpoint, hacker earth, etc.
@akulathreye8563
@akulathreye8563 3 жыл бұрын
yes , how do i make it so that i can configure the rat to go both up as well as down ? should i just add another condition where ........ if(isSafe(x,y-1)) return true ; and put the sol array = 1 inside the if statement ? similarly inside all the true statements i will update the value of the solution ?
@rutvikrana512
@rutvikrana512 3 жыл бұрын
@@akulathreye8563 ... yes, use matrix array to Check if Rat has visited a spot or not, if yes you can’t go there if no go there, all possible directions you have to check in loop and in each loop make Recursion. It’s same problem as sudoku solving, but we just have to stop when we find our destination/exit point. We can find shortest path to destination also by not returning true if we find destination, just update minimum distance whenever we get to destination. But if you are going in all direction, then you can’t use dynamic programming. You must use Recursion
@akulathreye8563
@akulathreye8563 3 жыл бұрын
@@rutvikrana512 Also how come she has not deallocated the memory at the end of the code ? using "delete"?
@learnwithanuj9466
@learnwithanuj9466 2 жыл бұрын
This is really great 👍👍
@mjustboring
@mjustboring 3 жыл бұрын
theres a catch here we should also use delete operater before ending of program... to neglect the issue of memory leak...
@ShivaKumar-qq8qm
@ShivaKumar-qq8qm Жыл бұрын
concept cleared in such a good manner waah!
@saikiran2356
@saikiran2356 2 жыл бұрын
Really helped me for leet code word search
@saptorshibairagya970
@saptorshibairagya970 Жыл бұрын
Areh wah ❤️👌❤️
@csea_37_shayoribhowmick53
@csea_37_shayoribhowmick53 Жыл бұрын
Thank you so much ❤
@jivantoshniwal2261
@jivantoshniwal2261 3 жыл бұрын
Beat explanation
@harsh9558
@harsh9558 2 жыл бұрын
This is really some great quality content!
@harshitrajshorts0001
@harshitrajshorts0001 3 жыл бұрын
Interviewer be like: paise kitne loge decide Kar le 🤣🤣
@lowercaseguy3578
@lowercaseguy3578 3 жыл бұрын
Ur code is beautiful.
@neelshah789
@neelshah789 3 жыл бұрын
Instead of passing whole 2d array as an argument we can just declare it globally
@akankshaverma5804
@akankshaverma5804 3 жыл бұрын
Thankyou so much backtracking really scared me but you made it possible ❤️❤️
@shivamkumar-qp1jm
@shivamkumar-qp1jm 3 жыл бұрын
Use BFS or DFS it will help to solve bactracking
@ETEAMaster15202
@ETEAMaster15202 2 жыл бұрын
well done upna ma'am
@sayanraha77
@sayanraha77 2 жыл бұрын
very nice explanation out here loved it
@aryanagarwal2071
@aryanagarwal2071 3 жыл бұрын
Pls deallocate the memory at the end of program, it is a good practice.
@kunalgulati3358
@kunalgulati3358 2 жыл бұрын
Nice video, thanks
@nishantyadav7461
@nishantyadav7461 3 жыл бұрын
Dii op - merko bhi pasnad nhi tatao wale You qre best ❤️
@suvamgupta2914
@suvamgupta2914 3 жыл бұрын
Mast explanation tha, just loved it and Thank You so much for making these videos ❤️
@bosesj
@bosesj 3 жыл бұрын
1. I think the rat ll go to down and right respectively when increasing 'x' and 'y',, not the other way cuz 'x' denotes the row and 'y' column in 2D array, it its represented as arr[x][y] = {..{..}, {..}..} and, lets add two more direction >>> 2. And the rat may have to go up and left too if needed. BUt don't be so hasty cuz just adding another two calls like 1.if(ratinMaze(arr, x, y-1, n, solArr))//left{...} 2.if(ratinMaze(arr, x-1, y, n, solArr))//up {...} in the function will introduce us with a terrible bug, which ll cause an infinity loop at some point (try to think about it, u ll see when). The only solution is what we do in real life, keeping track of the way we came along so that we don't fell in a 'blind loop' (like in movies, when hero keeps visiting same point 5 6 times before he finally realised that he's lost(but the program wont #lol)). So we need a ifVisited function for that,, and voila! we are ready for any maze with that simple function. the COde >>> bool isVisited(int **solArr, int x, int y) { if(solArr[x][y] == 1)return true; return false; } bool ratinMaze(int **arr, int x, int y, int n, int **solArr) { if(isSafe(arr, x, y, n) && !isVisited(solArr, x, y)) { ........ if(ratinMaze(arr, x, y-1, n, solArr))//left { return true; } if(ratinMaze(arr, x-1, y, n, solArr))//up { return true; } ..... }
@easycodingwithsumit
@easycodingwithsumit 2 жыл бұрын
Thankyou so much mam really a very good explaination.
@raidsraids3647
@raidsraids3647 3 жыл бұрын
thank you so much ,respect
@hsingh-13
@hsingh-13 3 жыл бұрын
Now, we have a chance to be the 1st Commentor 😂😂😂😂
@hsingh-13
@hsingh-13 3 жыл бұрын
But I m late 😭 😂
@sahilsawal
@sahilsawal 3 жыл бұрын
Awesome Ma'am :) 🔥😇👍👌🙏👏✌☺👋😀
@ranjitkoragoankar
@ranjitkoragoankar 3 жыл бұрын
Thank You So Much
@mtr2936
@mtr2936 3 жыл бұрын
This is the best explanation ever ..... thanku concept cleared
@johnhammond3605
@johnhammond3605 2 жыл бұрын
Need more detail on int** ...what is dynamic memory in array.... I don't recall this thing being taught in this series
@anurajsingh8137
@anurajsingh8137 3 жыл бұрын
Waiting Bhaiya...Awsome series
@neetupandey7313
@neetupandey7313 3 жыл бұрын
Majjjee hi aaa gaye lecture ko sunke toh!!! Thank you bhaiya didi and whole team!!!🕺🏽🕺🏽🕺🏽🕺🏽🕺🏽❤️❤️❤️
@rudra_sanyal1679
@rudra_sanyal1679 3 жыл бұрын
great explanation
@ramgopalbhajans3982
@ramgopalbhajans3982 2 жыл бұрын
Rahul is very lucky guy.
@bibigulotepbergenova3814
@bibigulotepbergenova3814 3 жыл бұрын
thank you very much!!
@nitishsingh3470
@nitishsingh3470 3 жыл бұрын
Amazing video very nice explanation
@aswinbarath
@aswinbarath 3 жыл бұрын
🔥🔥🔥Verithanam🔥🔥🔥
@himanshuprem600
@himanshuprem600 3 жыл бұрын
thank you.......
@saikeerthanchiluka4027
@saikeerthanchiluka4027 Жыл бұрын
Thank you mam
@theBeingralph
@theBeingralph 3 жыл бұрын
Aman bhaiya ki team is savoir in true sense ❤️
@akshunair3367
@akshunair3367 3 жыл бұрын
Thank you guys!
@Utkrshrma
@Utkrshrma 3 жыл бұрын
rahul stud bhi hai or lucky bhi :')
@arnikchakraborty1553
@arnikchakraborty1553 3 жыл бұрын
rahul medical ka student hain pakka
@aadityasharma6855
@aadityasharma6855 3 жыл бұрын
@@arnikchakraborty1553 I got hurt.
@bhavuktomar7935
@bhavuktomar7935 3 жыл бұрын
didi ek baar dry run karke dikha diya karo plzzzzz.
@zarakib
@zarakib 10 ай бұрын
Thanks
@aneesaziz3611
@aneesaziz3611 3 жыл бұрын
thanks bhaiya.
@PAGADLAHEMANTHItVelTechChennai
@PAGADLAHEMANTHItVelTechChennai 2 жыл бұрын
please upload every video with English subtitles
@shivangisahay3301
@shivangisahay3301 3 жыл бұрын
This is amazing , urvi!
@mjustboring
@mjustboring 3 жыл бұрын
Didi aman bhaiya ki toh sab taareef karte hi hai kuch shitty peoples 🤬 ko chhod kar... but aapne kitna mast samajhaya... hats off... 🎩🎩... isse acha koi nhi samjha sakta... (free of cost especially)...
@kankanachowdhury3353
@kankanachowdhury3353 3 жыл бұрын
The explanation is 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
@minhazrahman4828
@minhazrahman4828 3 жыл бұрын
Love from Bangladesh 😊
@adityagupta9719
@adityagupta9719 3 жыл бұрын
very nice video
@swisswick5715
@swisswick5715 8 ай бұрын
aman bhaiya ka chuha backtracking krte hue chala hi gaya
@happybro7476
@happybro7476 8 ай бұрын
🤣🤣🤣🤣
@pratikshyabehera4546
@pratikshyabehera4546 3 жыл бұрын
ratinmaze.cpp: In function 'bool ratinMaze(int**, int, int, int, int**)': ratinmaze.cpp:17:18: error: invalid conversion from 'int' to 'int**' [-fpermissive] 17 | solArr = 1; | ^ | | | int How to solve this?
@knowledgehub1583
@knowledgehub1583 3 жыл бұрын
Thank u thanku bhaiyaaa so much
@aryanrana9025
@aryanrana9025 3 жыл бұрын
Why we wrote x
@job_freak
@job_freak 3 жыл бұрын
Superb
@gauravsinghrathore9000
@gauravsinghrathore9000 3 жыл бұрын
One of the best video on Backtracking
@a.s.graphics8305
@a.s.graphics8305 2 жыл бұрын
I was scared of backtracking but this video has cleared the concept of backtracking to me , thanks for making these amazing videos.
@Callme-DS
@Callme-DS 3 жыл бұрын
didi concept to samjh aa jata hai per jaise aap implement kr rhe ho vaisa implementation apne aap se mai nhi kr pata
@yashpriyadeepkatta8823
@yashpriyadeepkatta8823 3 жыл бұрын
7:10 backtracking function for rat maze
@madhavaggarwal173
@madhavaggarwal173 3 жыл бұрын
microsoft wali didi, please topic ko achhe se samjhao jese isme most of the students ko dynamic memory allocation kai baare mai nhi pata tha so please its my request to take action on this point.. and After that, your content is very helpful for all of us and very relative examples you take to explain which is amazing. Thank you so much to give this level of content.
@madhavaggarwal173
@madhavaggarwal173 3 жыл бұрын
and yes this code is not working in my laptop i don't know why and even i checked 5 times for correction and everything is ok.. i share my code which is not working.please if someone try this then correct me through comment.. #include using namespace std; bool issafe(int **arr,int x,int y,int n){ if(xn; int**arr=new int*[n]; for(int i=0;i
@shivamsingh20
@shivamsingh20 3 жыл бұрын
Backtracking explained very nicely..... this course is highly recommended .....
@anishchauhan2647
@anishchauhan2647 3 жыл бұрын
Aman bhaiya you are great you have done a lot for us thanks 😁😁❣️❣️
@jiteshmeher6013
@jiteshmeher6013 3 жыл бұрын
Thanks bhaiya 😀
@siddhantmaharana3936
@siddhantmaharana3936 Жыл бұрын
This code seems to fail when we reach x==n-1 OR y==n-1, before reaching the last corner. The code gives a null output for this input {1,0,1,1,1},{1,0,1,0,1},{1,0,1,0,1},{1,0,1,0,1},{1,1,1,0,1} which is an N kind of shape. What is the changes we will have to make in order to work this out? Thank you.
@abhinavpj1729
@abhinavpj1729 3 жыл бұрын
I wrote the code myself😁,I used just 65 lines.. I used looping method😊😊
@jatinmaheriya2343
@jatinmaheriya2343 3 жыл бұрын
Bro can you send your code? because I wrote code but at the last row all the elements are printed zeros!
@prabhakumari5883
@prabhakumari5883 3 жыл бұрын
@@jatinmaheriya2343 #include using namespace std; bool isSafe(int** arr,int x,int y,int n){ if(xn; int **arr=new int*[n]; for(int i=0;i
@talhamumtaz2678
@talhamumtaz2678 2 жыл бұрын
Thanks a lot di, i don't know i am calling you di as an urdu speaker hahahah, your method of teaching is very very good.
@aakashdabas9490
@aakashdabas9490 3 жыл бұрын
Damm! Lucky Rahul !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :/ Ider tho dhur dhur tak khaet khali h !
@ayushagarwal016
@ayushagarwal016 3 жыл бұрын
Rahul bhai OP .
@Ramesh-ps7yn
@Ramesh-ps7yn 3 жыл бұрын
Thank u bhaiya 😊
@biswojitamishra8249
@biswojitamishra8249 3 жыл бұрын
I think she not bhaiya she is behen
@propeller8825
@propeller8825 2 жыл бұрын
Legends already knew rahul and Neha would end up together in the end
@vasutiwari4187
@vasutiwari4187 3 жыл бұрын
question : Rat in a Maze programming : Rat Race hotel: TRIVAGO
@anantsinghal3180
@anantsinghal3180 3 жыл бұрын
Sir web development course kab aayega yeh to batado.....🙏🏻🙏🏻
@JamilaMurtazaKagalwala
@JamilaMurtazaKagalwala 3 жыл бұрын
after 3-4 days !! given update on telegram grp
@AmanRaj-ux8cw
@AmanRaj-ux8cw 3 жыл бұрын
Go to compile coding Chanel.. Wha mil jayega ya fir free class start ho rhye hai.. G meet par
@nitishsingh3470
@nitishsingh3470 3 жыл бұрын
Yes when web dev course will come?
@harshulagarwal1755
@harshulagarwal1755 3 жыл бұрын
@@nitishsingh3470 3-4 days baad. I think before than 10 December toh aa hee jaayega
@jalsacentre1040
@jalsacentre1040 3 жыл бұрын
I couldn't solve one variation Where total no of parths asked and it is allowed to push boxes aside to vacate path Like . . . B . . . B . . B . => . . . B . . . . . . . . Or push Down
@MVCS_Theja
@MVCS_Theja 3 жыл бұрын
But there is a problem what if there is a solution where the rat has to go up,and if we can add a statement to go up, the if the x=0 we can't check the above becz ther is nothing above
@jenil151
@jenil151 3 жыл бұрын
Rahul and neha reminds me that it's aman bhaiya's channel 😂
Recursion | Last Lecture on Advanced Problems | Lecture 16.4
19:23
Apna College
Рет қаралды 135 М.
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 4,7 МЛН
HELP!!!
00:46
Natan por Aí
Рет қаралды 21 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 109 МЛН
L19. Rat in A Maze | Backtracking
25:10
take U forward
Рет қаралды 219 М.
N-Queen Problem - Backtracking | C++ Placement Course - 18.2
17:14
Apna College
Рет қаралды 274 М.
2nd year student cracks Paypal | Off-Campus selection | + PPI
31:29
Apna College
Рет қаралды 157 М.
The TRIPLE FOLDING phone has a Problem.
12:54
Mrwhosetheboss
Рет қаралды 2,4 МЛН
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Lecture 82: Rat in Maze Problem || Backtracking Day 1 || C++ Placement Series
31:37
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 996 М.
How I started coding from 0 and cracked Amazon, Google & Microsoft
9:43
Ashish Pratap Singh
Рет қаралды 547 М.
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 4,7 МЛН