Skip to main content

Combinations

Learn Combinations (Recursion & Backtracking, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Choosing K Elements, Order Doesn't Matter Combinations differ from permutations by ignoring ORDER - {1,2} and {2,1} count as the SAME combination. The backtracking trick: always choose elements in INCREASING index order (never look backward), which naturally avoids generating the same combination twice.

More lessons in Recursion & Backtracking