K20

Symmetric Tree Check

Junior Level Candidate
Target Time: 15 - 20 Minutes
Type: BOOLEAN

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) -> bool

Input & Output Contract

Output Rule:True veya False.

System Constraints

0 <= agac.length <= 1000
-100 <= agac[i] <= 100

Example Execution Walkthrough

agac = [1, 2, 2, 3, 4, 4, 3] -> Simetriktir -> True
agac = [1, 2, 2, None, 3, None, 3] -> Simetrik değildir -> False

Example Test Scenarios (3)

Example 1: Symmetric
Input:[[1,2,2,3,4,4,3]]
Expected Output:true
Example 2: ASymmetric
Input:[[1,2,2,null,3,null,3]]
Expected Output:false
Example 3: Boş Ağaç
Input:[[]]
Expected Output:true
Loading Python Editor...
Input Parameters
[
  [
    1,
    2,
    2,
    3,
    4,
    4,
    3
  ]
]
Expected Output
true