0PricingLogin
Competitive Programming Academy · Lesson

Permutations and the N-Queens Idea

Place items and backtrack on conflicts.

From Subsets to Orderings

A permutation is an arrangement of all elements in some order. Generating them is the next backtracking skill after subsets. 🔀

How Many Permutations

There are n factorial permutations of n items, because the first slot has n choices, the next n minus one, and so on. It grows fast.

All lessons in this course

  1. Think Recursively: Base & Recurse
  2. Generate All Subsets
  3. Permutations and the N-Queens Idea
  4. Prune to Survive the Time Limit
← Back to Competitive Programming Academy