This video provides an overview of my solution.
- [Voiceover] Let's look briefly at some commonalities…between the solutions.…For both solutions, we'll represent queen placements…with a vector of numbers, whose…length is the size of the board.…So we'll have eight numbers for an eight by eight board.…Position of each element within the vector…represents the associated column that a queen is placed in.…Each value in the vector represents the row that…that queen was placed in.…So the value zero, is on the zeroth row,…and four is on four, using zero indexing.…Given this flat representation,…queens can not be in the same column,…so are unable to attack vertically.…
All the numbers in the list are distinct,…then each queen is on its own row,…and unable to attack horizontally.…This helps us solve part of the problem on its own.…To complete the solution, we also need to ensure…that queens can't attack each other diagonally.…We'll keep these observations in mind…as we discuss both approaches,…since they both build on this foundation.…The first solution we'll build,…uses what I'll call the permutations approach.…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- 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.