Skip to content

Commit 42378ba

Browse files
committed
clean
1 parent 83c9061 commit 42378ba

25 files changed

+28
-115
lines changed

100.IsSameTree.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
// 100. Same Tree
22

33
// Given the roots of two binary trees p and q, write a function to check if they are the same or not.
4-
54
// Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
65

7-
8-
96
// Example 1:
10-
11-
127
// Input: p = [1,2,3], q = [1,2,3]
138
// Output: true
149
// Example 2:
15-
16-
1710
// Input: p = [1,2], q = [1,null,2]
1811
// Output: false
1912

101.IsSymmetric.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22

33
// Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
44

5-
6-
75
// Example 1:
8-
9-
106
// Input: root = [1,2,2,3,4,4,3]
117
// Output: true
128
// Example 2:
13-
14-
159
// Input: root = [1,2,2,null,3,null,3]
1610
// Output: false
1711

102.LevelOrder.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22

33
// Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).
44

5-
6-
75
// Example 1:
8-
9-
106
// Input: root = [3,9,20,null,null,15,7]
117
// Output: [[3],[9,20],[15,7]]
128
// Example 2:
139

1410
// Input: root = [1]
1511
// Output: [[1]]
1612
// Example 3:
17-
1813
// Input: root = []
1914
// Output: []
2015

103.ZigzagLevelOrder.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
// 103. Binary Tree Zigzag Level Order Traversal
22
// Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).
33

4-
5-
6-
// Example 1:
7-
8-
4+
// Example 1:
95
// Input: root = [3,9,20,null,null,15,7]
106
// Output: [[3],[20,9],[15,7]]
117
// Example 2:
12-
138
// Input: root = [1]
149
// Output: [[1]]
1510
// Example 3:
16-
1711
// Input: root = []
1812
// Output: []
1913

104.MaxDepth.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@
44

55
// A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
66

7-
8-
97
// Example 1:
10-
11-
128
// Input: root = [3,9,20,null,null,15,7]
139
// Output: 3
1410
// Example 2:
15-
1611
// Input: root = [1,null,2]
1712
// Output: 2
1813

107.LevelOrderBottom.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
// 107. Binary Tree Level Order Traversal II
22

3-
// Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).
4-
5-
3+
// Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values.
4+
// (i.e., from left to right, level by level from leaf to root).
65

76
// Example 1:
8-
9-
107
// Input: root = [3,9,20,null,null,15,7]
118
// Output: [[15,7],[9,20],[3]]
129
// Example 2:
13-
1410
// Input: root = [1]
1511
// Output: [[1]]
1612
// Example 3:
17-
1813
// Input: root = []
1914
// Output: []
2015

108.SortedArrayToBST.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
// 108. Convert Sorted Array to Binary Search Tree
2-
// Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.
3-
4-
2+
// Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced
3+
// binary search tree.
54

65
// Example 1:
7-
8-
96
// Input: nums = [-10,-3,0,5,9]
107
// Output: [0,-3,9,-10,null,5]
118
// Explanation: [0,-10,5,null,-3,null,9] is also accepted:
12-
139
// Example 2:
14-
15-
1610
// Input: nums = [1,3]
1711
// Output: [3,1]
1812
// Explanation: [1,null,3] and [3,1] are both height-balanced BSTs.

109.SortedListToBST.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
// 109. Convert Sorted List to Binary Search Tree
22

33
// Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree.
4-
5-
6-
74
// Example 1:
8-
9-
105
// Input: head = [-10,-3,0,5,9]
116
// Output: [0,-3,9,-10,null,5]
127
// Explanation: One possible answer is [0,-3,9,-10,null,5], which represents the shown height balanced BST.
138
// Example 2:
14-
159
// Input: head = []
1610
// Output: []
1711

110.IsBalanced.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
// 110. Balanced Binary Tree
22

33
// Given a binary tree, determine if it is height-balanced.
4-
54
// For this problem, a height-balanced binary tree is defined as:
6-
75
// a binary tree in which the left and right subtrees of every node differ in height by no more than 1.
8-
9-
10-
116
// Example 1:
12-
13-
147
// Input: root = [3,9,20,null,null,15,7]
158
// Output: true
169
// Example 2:
17-
18-
1910
// Input: root = [1,2,2,3,3,null,null,4,4]
2011
// Output: false
2112
// Example 3:
22-
2313
// Input: root = []
2414
// Output: true
2515

111.MinDepth.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
// 111. Minimum Depth of Binary Tree
22
// Given a binary tree, find its minimum depth.
3-
43
// The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
5-
64
// Note: A leaf is a node with no children.
7-
8-
9-
105
// Example 1:
11-
12-
136
// Input: root = [3,9,20,null,null,15,7]
147
// Output: 2
158
// Example 2:
16-
179
// Input: root = [2,null,3,null,4,null,5,null,6]
1810
// Output: 5
1911

0 commit comments

Comments
 (0)