Learn about the solution to the eight queens problem.
- [Instructor] In conclusion, we were able to solve…the eight queens problem with a backtracking algorithm…or in code it's a recursive call to a method…doing the lookup and in particular…we went looking for where we can place the next queen…without causing any conflicts.…We were able to significantly simplify the problem…by choosing a novel data representation.…Thanks to some understanding of the underlying problem…we realized that we're only placing queens,…and it doesn't matter what color they are,…and so a single piece for a single player…meant that we could simplify down to just listing…in which column each of the queens are and which row.…
And we didn't have to actually track…the columns and the rows separately…because we knew we would have a conflict…if there was more than one queen on the same row…or the same conflict.…And so I chose to only represent…the chessboard with a single array.…My array represented the columns…and so each element in the array…represented a queen placed in row…as per the value in that element.…
Skill Level Intermediate
1. Problem 1: Pond Oreille
2. Problem 2: Where Am I?
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Facial Recognition
6. Problem 6: Real-Time Information Dashboard
Next steps2m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.