6.1 N Queens Problem using Backtracking

  Рет қаралды 2,063,778

Abdul Bari

Abdul Bari

Күн бұрын

Пікірлер: 507
@tanmaychaudhary2801
@tanmaychaudhary2801 Жыл бұрын
It has been 5 years but still these videos are better than new ones by other youtubers.....i am referring to these in 2023...thank you sir
@jaspreetsinghkalsi2572
@jaspreetsinghkalsi2572 Жыл бұрын
me too mate
@nishaldevadiga6766
@nishaldevadiga6766 Жыл бұрын
yeah and his videos will be the best considering future as well! 👑
@arman9957
@arman9957 8 ай бұрын
And now it is 2024, still it is better .
@vyombhatt44
@vyombhatt44 8 ай бұрын
yea lol @@arman9957
@yaswanthkavuri71
@yaswanthkavuri71 5 ай бұрын
Now it's been 6 years lol😂
@Kuriocity
@Kuriocity 5 жыл бұрын
*I am from ECE Background, trying my hard for product based companies and I want to thank Sir Abdul Bari for all the Concepts which helps me in competitive programming*
@manoja538
@manoja538 4 жыл бұрын
Bro u got placed?
@TG-ql2fv
@TG-ql2fv 3 жыл бұрын
No
@Kuriocity
@Kuriocity 3 жыл бұрын
@@manoja538 Yes bro,I graduated last year and had 3 job offers
@NS-sd3mn
@NS-sd3mn 3 жыл бұрын
@@Kuriocity lucky u, next year i have placement and i m scared to shit
@Kuriocity
@Kuriocity 3 жыл бұрын
@@NS-sd3mn don't worry... just keep practicing and solving questions and you ll get what you deserve
@saimahumma4724
@saimahumma4724 6 жыл бұрын
Abdul Bari Sir I just wanted to thank you. I have successfully completed my M.Tech with good CGPA and yeah topped at college level. You contribute a lot to my grand success. Thanks a lot. But I regret for I could not find your videos during my B.Tech. Anyways, ALHAMDULILLAH. Now watching your videos to prepare for teaching demos.
@jayantkeer3416
@jayantkeer3416 6 жыл бұрын
You are the best teacher of algorithm in KZbin
@ayounghosh9218
@ayounghosh9218 5 жыл бұрын
thank you for all your lectures, you are like a god sent to us.
@mohammedrafathali7702
@mohammedrafathali7702 3 жыл бұрын
Ok i can Proudly say that He was my lecturer At College ❤️
@Shubham_30_12
@Shubham_30_12 3 жыл бұрын
which college???
@siddharthmagadum16
@siddharthmagadum16 3 жыл бұрын
which college ?
@cursedblessing9619
@cursedblessing9619 3 жыл бұрын
@@Shubham_30_12 Muffakham Jah College of Engineering & Technology
@kausikkar2587
@kausikkar2587 3 жыл бұрын
@@cursedblessing9619 It is in Hyderabad, right?
@omerullah
@omerullah 3 жыл бұрын
@@kausikkar2587 yep, he is from Hyderabad. He once came to my college as well for a seminar.
@sandeepmandrawadkar9133
@sandeepmandrawadkar9133 5 жыл бұрын
That's great contribution Professor! Everything in the presentation is superb - contents - speed of delivery - board usage - selected examples Everything Hats off to you Sir 🙏
@ojcgv21
@ojcgv21 3 жыл бұрын
A simple way to explain the N queens problem & solution, love it! Greetings from France
@aradhyasingh524
@aradhyasingh524 4 ай бұрын
😂🎉
@nishes
@nishes 5 жыл бұрын
i'm currently watching to save my self from failing my class thank you
@AnitShrestha
@AnitShrestha 5 жыл бұрын
Thank you. One of the best description on Backtracking, and its difference with Dynamic Programming.
@TridibSamanta
@TridibSamanta 5 жыл бұрын
Great ! You are a great Teacher. Thanks for saving my Design and analysis of Algorithm Paper. #Respect
@aries3690
@aries3690 3 жыл бұрын
Thank you so much for your videos! I am trying to self-learn competitive programming and your videos are a great help to so many students around the world! Keep doing what you do best!
@LucasMagnum
@LucasMagnum 3 жыл бұрын
You are so good at explaining this. Thank you so much for your time!
@mranjaan5193
@mranjaan5193 Жыл бұрын
where are you from Lucas
@helalali6555
@helalali6555 4 жыл бұрын
Abdul bari is a awesome person..he cleared many of my concept....keep helping us Sir
@kaushalagrawal1620
@kaushalagrawal1620 4 жыл бұрын
halal means food that is allowed to eat allowed ali hahaha
@helalali6555
@helalali6555 4 жыл бұрын
@@kaushalagrawal1620 yes bro you are right but its helal that means moon
@ASHJACX
@ASHJACX 6 жыл бұрын
it was a great explanation, you deserve million views
@harixhyadav
@harixhyadav 6 жыл бұрын
whatsup bro
@jivanmainali1742
@jivanmainali1742 4 жыл бұрын
@@harixhyadav got placed??
@samiazaman5240
@samiazaman5240 4 жыл бұрын
This is such a wonderfully satisfying concept, and a great video, too. Always love sir's peaceful energy.
@grasstoucher856
@grasstoucher856 2 жыл бұрын
exceptional articulation sir. I myself get's confused going through it step by step while you're able to trace it accurately for each node. Really inspiring.
@kimmara6475
@kimmara6475 Жыл бұрын
Please shared me if you got any notes for tis.
@zahid_9217
@zahid_9217 Жыл бұрын
I have done crazy amount of practice finally I understand it perfectly. keep doing practice you are going to master it.
@Kuil..
@Kuil.. 3 ай бұрын
Those who watch in 2024 assemble here guys 🫂😍
@subinaypanda9936
@subinaypanda9936 4 жыл бұрын
This is very good sir. I was in very confusion of brute force searching of solutions of Sudoku. But the lectures of you have cleared this. Your explanation is too good and I am really very happy after seeing your videos. Thank you sir for teaching us.
@Lucifer-jl9vh
@Lucifer-jl9vh 2 жыл бұрын
Thank you Abdul Bari sir for your videos on Algorithms. They are helping a lot of students like me. Your work is very much appreciated.
@shubhampandey8765
@shubhampandey8765 9 ай бұрын
Can't be grateful enough for this Man's work , hats off.
@parneetkaur2588
@parneetkaur2588 6 жыл бұрын
Everytime i used to watch your lectures but never bothered to comment...but sir you way of teaching is superb! Thank you for your lectures.
@shoaibMalik49
@shoaibMalik49 5 жыл бұрын
Amazing sir. I loved your videos.. I'm watching these videos a night before exams
@aniruddhsingh3501
@aniruddhsingh3501 2 жыл бұрын
sir love your videos...kindly consider including the algorithms along with the explanation
@saksham8566
@saksham8566 6 жыл бұрын
Very nicely explained! And not too hard English used 😋
@rajivtechknow393
@rajivtechknow393 4 жыл бұрын
After learning from your video lecture I completed certified course very easily u are great🙏
@fahmidhossainSakib
@fahmidhossainSakib 2 жыл бұрын
this guy is amazing ! teaching us with lots of care and effort.
@vman049
@vman049 4 жыл бұрын
Note that the reason you're able to restrict the first queen to the first row, second queen to the second row, and so on is because they are all queens, so it doesn't matter which queen is on which row -- they will all function the same way. In other words, the ordering of the queens doesn't matter. You could just as well put queen 3 in row 4 and queen 4 in row 3 and achieve the same result. We are forcing there to be a single queen per row, since otherwise two queens would be under attack, and are just interested in specifying which _column_ the queen in each row will be on.
@soumyajitdatta9016
@soumyajitdatta9016 4 ай бұрын
Bro u just said something that will change the way earth revolves around the sun
@sidindian1982
@sidindian1982 Жыл бұрын
Well Explained the Solutions .. specially that mirror image of last vedio footage 13:30 ... Thanks Sir
@sergekamga915
@sergekamga915 3 жыл бұрын
Your explanations are super clear. Can you add videos about topological sort, strongly connected components, and bipartite graphs?
@DHARMAKD-y5b
@DHARMAKD-y5b 5 ай бұрын
the way u are teaching is excellent sir.please continue to make videoes
@vigneshrao4965
@vigneshrao4965 2 жыл бұрын
Hi sir I saw the video of n queens problem ,it helped me lot to create my own presentation Now I am in need tug of war problem using backtracking
@patrickmayer9218
@patrickmayer9218 11 ай бұрын
*3 things to worry about so queens don't attack each other: same row, same column, and same diagonal *generate a state-space tree *the default is that the nth queen is in the nth column and nth row (they form a diagonal on the board from left to right) the state-tree backtracking starts at 8:40 Thanks for the video!
@magentata1942
@magentata1942 3 жыл бұрын
without your lectures we are wasted sir♥️♥️💯🔥
@SPOIDERMON_1
@SPOIDERMON_1 7 ай бұрын
Tb tera career gya
10 ай бұрын
Brilliant explanation. Thanks, Professor Abdul!
@mukitmahmudul2616
@mukitmahmudul2616 4 жыл бұрын
I love ur way of teaching sir.u makes the lesson easy.Love from bangladesh.
@pinnumishra4563
@pinnumishra4563 7 ай бұрын
What a great way of explanation. Thank you so much Sir G
@supriyasaha6168
@supriyasaha6168 Ай бұрын
Thank you so much Sir for explaining it so clearly🙏
@syedmahasibali2324
@syedmahasibali2324 5 жыл бұрын
Made the problem easier well done Great privilege to see this
@supriyachauhan5341
@supriyachauhan5341 3 жыл бұрын
Don't know what I'd do without you!!
@Recordingization
@Recordingization 4 жыл бұрын
Thank you,Sir.You made the searching problem easy to understand.
@dan-gu1ty
@dan-gu1ty 5 жыл бұрын
Abdul sir, you are the best ♥
@dr.vinodkumarchauhan3454
@dr.vinodkumarchauhan3454 6 жыл бұрын
Sir, I suggest you to make comments about the complexity and algorithm/program for each problem, in that way it will present complete discussion about a problem otherwise students need to search other content for getting answers to these questions. Thanks!
@user-wc1sm8cj8s
@user-wc1sm8cj8s 3 жыл бұрын
Very great explanation. Thanks sir, you earned my respect
@jonelleyu1895
@jonelleyu1895 2 жыл бұрын
Thank you Sir Abdul Bari! One question - at the end, you mirror the solution 1 vertically and get solution 2. Why not keep mirroring solution 1and 2 horizontally to get totally 4 solutions? Thank you.
@Inndjkaawed2922
@Inndjkaawed2922 Жыл бұрын
if you mirror them horizontally, you get the same solution as the mirror image or rotating the positions clockwise or anticlockwise
@rajingajadhar4135
@rajingajadhar4135 10 ай бұрын
First year here, this was extremely helpful!
@nandanbanerji8309
@nandanbanerji8309 4 жыл бұрын
Really Great Prof. Bari. very nice demonstration.
@carolineignacior.4480
@carolineignacior.4480 3 жыл бұрын
you are just THE BEST
@akashmaurya5338
@akashmaurya5338 5 жыл бұрын
how many of you are watchin 1.5x or 2x hit like here kabi kabhi nhi hamesha lagta hai ki sir ich bhagwan hai.... akash gaytunde
@micimaos
@micimaos 5 жыл бұрын
nopp,.. Normal (Y)
@CliffCarmichael
@CliffCarmichael 5 жыл бұрын
Damn, you must be either very alone, or very deprived in life.
@ritam_chakraborty
@ritam_chakraborty 5 жыл бұрын
Watching in 2.5x
@abhishekguptasarma2060
@abhishekguptasarma2060 4 жыл бұрын
@@ritam_chakraborty That will be overkill and somewhat unbelievable..
@ritam_chakraborty
@ritam_chakraborty 4 жыл бұрын
@@abhishekguptasarma2060 no man, 2.5 is totally resealable.
@ajithnayak2754
@ajithnayak2754 4 жыл бұрын
@Abdul Bari Sir, your explanations are so amazing!!
@phdgateway4127
@phdgateway4127 6 жыл бұрын
Dear Guru...! Its very great that you've explained well .but we as a learners we'd also expect it in Algorithm tracing .if you possible could you please make it out sir
@rajeshg3570
@rajeshg3570 2 жыл бұрын
I'm little confused with this. at 3:44 , you are saying, we will not consider the attacks and try to arrange. Then you are saying, let's not place Q2 in same row or same column. This is where I'm confused. Why not place Q2 in either same row or same col when we say ignore the constraints for sometime. Any specific reason or am i missing anything.
@ankoor
@ankoor 4 жыл бұрын
n-Queens Python: class Board(object): def __init__(self, n): self.n = n self.board = [[0 for _ in range(n)] for _ in range(n)] def solve(self, row, result, output): if row == self.n: output.append(result[:]) return for col in range(self.n): if self.isSafeCell(row, col): self.board[row][col] = 1 result.append((row, col)) self.solve(row+1, result, output) self.board[row][col] = 0 result.pop() def nQueens(self): result = [] output = [] self.solve(0, result, output) return output def isSafeCell(self, row, col): # Vertical check for r in range(row-1, -1, -1): if self.board[r][col]: return False # Main diagonal check r = row - 1 c = col - 1 while r >= 0 and c >= 0: if self.board[r][c]: return False r -= 1 c -= 1 # Minor diagonal check r = row - 1 c = col + 1 while r >= 0 and c < self.n: if self.board[r][c]: return False r -= 1 c += 1 return True def display(self): for row in self.board: print(row) b = Board(4) b.nQueens()
@dibyajyoti3038
@dibyajyoti3038 2 жыл бұрын
Java!??
@minato7621
@minato7621 Жыл бұрын
@@dibyajyoti3038 python
@kadirilavanyareddy6033
@kadirilavanyareddy6033 3 жыл бұрын
Thanks sir... U gave us THE BEST lecture
@arkapravabhattacharya9472
@arkapravabhattacharya9472 6 жыл бұрын
After the first arrangement of all the queens,shuffling of q3 was done and so was done for q4. As q4 was already in 4th column why you have written q3 in 4th column?
@Shivam22.1.97
@Shivam22.1.97 6 жыл бұрын
wonderful teacher u r ..........sir most of the student try to study cormen book of algo but failed to do so ......sir plz make videos of cormen book explanation .........it will be of grt help to many..........thanks
@sarahchopra6171
@sarahchopra6171 18 күн бұрын
Amazing explanation
@KovalovAnton
@KovalovAnton 5 жыл бұрын
Like -> Watch -> Practice -> Repeat
@saicharan8675
@saicharan8675 5 жыл бұрын
Really helping your videos alot professor.. Thank you
@srikanthuppala8297
@srikanthuppala8297 5 жыл бұрын
Great Sir. Clear explanation. Thank you so much Sir.
@christopherd7029
@christopherd7029 6 жыл бұрын
Sir, can you please solve 8-queen problem? I really like your explanations 👍😊
@christopherd7029
@christopherd7029 6 жыл бұрын
Abdul Bari okay thank you sir
@harshgupta2710
@harshgupta2710 6 жыл бұрын
it would be more better if u include psuedo code with these!!
@harshgupta2710
@harshgupta2710 6 жыл бұрын
although the explation was ultimate and well explained :)
@KaranBulani
@KaranBulani 6 жыл бұрын
Abdul Bari you haven't yet
@chiragpariani7828
@chiragpariani7828 5 жыл бұрын
@@abdul_bari Please add
@yashpadia940
@yashpadia940 5 жыл бұрын
Expecting an algo for the same
@fameflu
@fameflu 5 жыл бұрын
@@abdul_bari where psuedo code?
@udaynithin8161
@udaynithin8161 Жыл бұрын
sir we are back benchers so sorry for this meru explain chesey way ke okkati chpali sir me modda ke salam me gudha ke gulham hattsoff sir for passing out in this subject
@glitchmaker0309
@glitchmaker0309 5 ай бұрын
This guy teaches a million times better than my gibbering algorithm teacher.
@chinmayiadiga515
@chinmayiadiga515 4 жыл бұрын
one of the best AI videos that I have come across in youtube.. well explained .. Good job sir..
@u-mimi
@u-mimi 5 жыл бұрын
wow.. It's really fun. I'm not good at English but this lecture is easy to understand. I already know backgrounds, but it's very fun to me. now i'm conside buy ur other lecture.
@chamnil8666
@chamnil8666 4 жыл бұрын
Thank you sir .you are a great teacher.Great explanation.I am subscribed.
@ben-hah-meen
@ben-hah-meen 5 жыл бұрын
For the equation at 8:15, should the 3 above the sigma be n-1 when you change 4 to n? i.e. 1 + sigma i=0 to n-1 [pi j=0 to i (n-j)]
@vinodjindal7210
@vinodjindal7210 4 жыл бұрын
it a simple permutation sigma(npi) where i varies from 0 to 4.
@sharda16april
@sharda16april 4 жыл бұрын
yes, that is correct. I corrected my notes.
@k-ananya9657
@k-ananya9657 3 жыл бұрын
Thank you sir! Really you are a great person, lots of love and respect
@abanur3163
@abanur3163 5 жыл бұрын
thank you sir i want to ask do you have any tution class inside india that you train as
@ajinkyaadhotre5336
@ajinkyaadhotre5336 4 жыл бұрын
idk about his pvt tutions but he is available on UDEMY ,search for him on udemy
@abanur3163
@abanur3163 4 жыл бұрын
@@ajinkyaadhotre5336 yes thanks, later i realize that he is available on udemy and i pass this subject
@arunkumaragrawal7486
@arunkumaragrawal7486 5 жыл бұрын
How can I solve 8 queen's problem the tree become very complicated... Plz sir advice me what to do...
@niharinthselva3613
@niharinthselva3613 5 жыл бұрын
@@abdul_bari yes that's a kinder way to put it xD
@naziyafirdoussayyed8491
@naziyafirdoussayyed8491 5 жыл бұрын
I would love to skip the question of 8 queen problem 😁 if it comes in exam😋
@Endrit719
@Endrit719 5 жыл бұрын
@@naziyafirdoussayyed8491 lol , I've got the exam on friday if the question is 8 queens I am gonna say that Abdul Bari said don't try with 8 queens xD
@naziyafirdoussayyed8491
@naziyafirdoussayyed8491 4 жыл бұрын
@@Endrit719 hahahahhaha... Good one. But thank God I passed in exam without solving the 8 Queen's problem. Hehehe
@naziyafirdoussayyed8491
@naziyafirdoussayyed8491 4 жыл бұрын
@UCTeCKWvk68v3WZsJ0ntufFQ areeee..hahahha " I love u " kis liye
@michaelujkim
@michaelujkim 4 жыл бұрын
What do you do about the solutions that don’t have q1 in the first row? Wouldn’t that open the solution space?
Ай бұрын
All fun and games until you gotta write the code for that baby
@chandud4255
@chandud4255 6 жыл бұрын
Explanation is awesome but please add programmatic pseudo code also
@phoneix24886
@phoneix24886 Жыл бұрын
There is a great video on Neetcode which uses a brilliant trick to solve this problem.
@abhinavdadhich2311
@abhinavdadhich2311 6 жыл бұрын
god aur banao aaise log duniya mai itne clear minded
@soumodipsengupta9902
@soumodipsengupta9902 Жыл бұрын
Perfect explanation, Now I am able to code and understand deeply this solution !
@prayagshah1247
@prayagshah1247 5 жыл бұрын
Thank you very much sir I have clear this subject in just two days before exams👦
@Mr.Yadav1997
@Mr.Yadav1997 4 жыл бұрын
You are excellent teaching in DDA subject TQ sir
@shasvatnayak2329
@shasvatnayak2329 3 жыл бұрын
You are an Inspiration sir✨
@Ashik-iu1oh
@Ashik-iu1oh 3 жыл бұрын
Thanku sir you are doing a great work ❤️😍💕
@sshiv908
@sshiv908 5 жыл бұрын
my favorite teacher on utube
@singhiitian3150
@singhiitian3150 4 жыл бұрын
thanks one ques that i think u have the row in which the queen 1,2 etc can be in otherwise there will be many more soln jus by onterchanging gthe pos of the queens .
@Momo-qr3rd
@Momo-qr3rd 2 жыл бұрын
You are the best teacher sir
@jishnuprasadhemaraghunanda4384
@jishnuprasadhemaraghunanda4384 5 жыл бұрын
Amazing sir Understood in a single go
@syedsaifahmed4103
@syedsaifahmed4103 5 жыл бұрын
Assalamualaikum sir. Your videos helped me a lot in studying and writing the exam very well and more than expected. I was feeling low before watching your videos bur my exam went brilliant. Thank you soo much sir. Me and all my frnds thank you a lot. May Allah bless you with success and happiness in your life. AAMEEN 😇😇🙌🙏🙏💝💘💞
@syedsaifahmed4103
@syedsaifahmed4103 5 жыл бұрын
@@abdul_bari thank you once again 😇
@Flutterdev6391
@Flutterdev6391 3 жыл бұрын
U serve the whole world
@sufyaansaeed7158
@sufyaansaeed7158 5 жыл бұрын
thank you so much for all your videos, major help!!
@tobiahrex
@tobiahrex 2 жыл бұрын
Can you/someone explain why we wrote (4-j), I was expecting Big-Pi (sum of products) right of Sigma. I understood everything but , can we write instead?
@yeet3810
@yeet3810 4 жыл бұрын
Thank you master you're the best explaning👍
@nishawandile3097
@nishawandile3097 Жыл бұрын
Thank you very much sir for so easy explaination.
@Gayathri_G
@Gayathri_G 3 ай бұрын
Best explanation ever!!!
@viky293
@viky293 2 жыл бұрын
Many Good things are free and under appreciated.
@gurunathreddy6908
@gurunathreddy6908 4 ай бұрын
Hi, I have one doubt using brute force approach is it possible to fit the elements in 3X3 matrix.
@shreyoshiraychaudhary8808
@shreyoshiraychaudhary8808 5 жыл бұрын
Sir, can you please show the steps to find the time complexity using the recurrence relation T(n) = nT(n-1) + n^2
@manvendrasinghsuriyal2144
@manvendrasinghsuriyal2144 4 жыл бұрын
Correct way of explanation
@Desireanshu
@Desireanshu 6 жыл бұрын
Thank you sir for clearly explaining step by step
@likhitha2350
@likhitha2350 6 жыл бұрын
For 8 queens do we have to find all the solutions or one solution is enough?
@veenuupanchal5854
@veenuupanchal5854 4 жыл бұрын
You are a great teacher.
6.2 Sum Of Subsets Problem - Backtracking
12:19
Abdul Bari
Рет қаралды 1,4 МЛН
6 Introduction to Backtracking - Brute Force Approach
8:15
Abdul Bari
Рет қаралды 1,2 МЛН
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 18 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 110 МЛН
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 322 М.
4.2 All Pairs Shortest Path (Floyd-Warshall) - Dynamic Programming
14:13
6.3 Graph Coloring Problem - Backtracking
15:52
Abdul Bari
Рет қаралды 1,1 МЛН
If Your Tech Job is Comfortable, You're in Danger
20:57
Thriving Technologist
Рет қаралды 23 М.
The Wordpress drama keeps getting worse
12:47
Theo - t3․gg
Рет қаралды 102 М.
Yes, Go Does Have Exceptions
ThePrimeTime
Рет қаралды 945
L14. N-Queens | Leetcode Hard | Backtracking
36:55
take U forward
Рет қаралды 416 М.
2.8.1  QuickSort Algorithm
13:43
Abdul Bari
Рет қаралды 3,2 МЛН
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 18 МЛН