K20
Symmetric Tree Check
Problem Statement & Objective
Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
Function Signature (Python)
symmetric_tree_check(root: list) -> boolInput & Output Contract
Output Rule:True veya False.
System Constraints
0 <= agac.length <= 1000
-100 <= agac[i] <= 100Example Execution Walkthrough
agac = [1, 2, 2, 3, 4, 4, 3] -> Simetriktir -> True
agac = [1, 2, 2, None, 3, None, 3] -> Simetrik değildir -> FalseExample Test Scenarios (3)
Example 1: Symmetric
Input:
[[1,2,2,3,4,4,3]]Expected Output:
trueExample 2: ASymmetric
Input:
[[1,2,2,null,3,null,3]]Expected Output:
falseExample 3: Boş Ağaç
Input:
[[]]Expected Output:
true