Skip to content

docs(backtracking): add runnable generateCombinations example (R50-T037) - #75

Open
nishadaniket174 wants to merge 1 commit into
S-AI-Projects:masterfrom
nishadaniket174:student/e26b07f0789/R50-T037
Open

nishadaniket174 wants to merge 1 commit into
S-AI-Projects:masterfrom
nishadaniket174:student/e26b07f0789/R50-T037

Conversation

@nishadaniket174

@nishadaniket174 nishadaniket174 commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

This PR adds an executable worked example for generateCombinations in Backtracking/AllCombinationsOfSizeK.js.

The example demonstrates how the algorithm generates combinations from the input, explains the decisive state transition during backtracking, and shows the expected final output.

Changes Made

  • Added a worked JSDoc example using the existing public function.

  • Explained the input, intermediate state, and final result.

  • Demonstrated the ordinary case with n = 3 and k = 2, producing:

    [[1, 2], [1, 3], [2, 3]]
  • Added boundary-case tests for:

    • n = 0, k = 0
    • n = 1, k = 1
  • Added an ordinary-case test for n = 3, k = 2.

  • Added checks for the expected results and relevant behavior, including input non-mutation.

  • Added task-specific verification evidence under work/R50-T037/.

  • Added work/R50-T037/check.py to execute the task checks and propagate failures.

Testing

Run the task-specific verification script:

python3 work/R50-T037/check.py

The runner is intended to execute the new checks and the repository's native test suite in non-watch mode.

Related Issue

Closes #37

Task: R50-T037
Target file: Backtracking/AllCombinationsOfSizeK.js
Function: generateCombinations

@nishadaniket174
nishadaniket174 force-pushed the student/e26b07f0789/R50-T037 branch from 7442fab to 4b623aa Compare November 21, 2026 14:20
@nishadaniket174 nishadaniket174 changed the title Student/e26b07f0789/r50 t037 docs(backtracking): add runnable generateCombinations example (R50-T037) Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant