feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent b434eb3a49
commit a7d29b7cce
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,30 @@ patterns:
- bfs
- tree-traversal
function_signature: "def is_complete_tree(root: TreeNode) -> bool:"
test_cases:
visible:
- input: { root: [1, 2, 3, 4, 5, 6] }
expected: true
- input: { root: [1, 2, 3, 4, 5, null, 7] }
expected: false
hidden:
- input: { root: [1] }
expected: true
- input: { root: [1, 2] }
expected: true
- input: { root: [1, null, 2] }
expected: false
- input: { root: [1, 2, 3, 4, 5, 6, 7] }
expected: true
- input: { root: [1, 2, 3, 4, null, 6, 7] }
expected: false
- input: { root: [1, 2, 3, null, null, 6, 7] }
expected: false
- input: { root: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }
expected: true
description: |
Given the `root` of a binary tree, determine if it is a *complete binary tree*.