All Posts

Leetcode 100: Same Tree

You are given two binary trees. Your task is to check if these two trees are the same. Two binary trees are considered the same if they are structurally identical and the nodes have the same value at each corresponding position.

Leetcode 102: Binary Tree Level Order Traversal

Given the root of a binary tree, your task is to return the level order traversal of its nodes’ values. This means you should traverse the tree level by level, from left to right at each level.

Leetcode 103: Binary Tree Zigzag Level Order Traversal

Given the root of a binary tree, your task is to return the zigzag level order traversal of its nodes’ values. This means you need to traverse the tree level by level, alternating between left to right and right to left on each level.

Leetcode 104: Maximum Depth of Binary Tree

You are given the root of a binary tree. Your task is to return the maximum depth of the tree. The maximum depth is defined as the number of nodes along the longest path from the root node down to the farthest leaf node.

Leetcode 107: Binary Tree Level Order Traversal II

Given the root of a binary tree, return the bottom-up level order traversal of its nodes’ values. This means that for each level, starting from the leaf level and moving towards the root, you should collect the node values from left to right.

Leetcode 111: Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is defined as the number of nodes along the shortest path from the root node down to the nearest leaf node. A leaf node is a node that does not have any children.