Skip to content

Commit 5faaef3

Browse files
refactor 671
1 parent f82c1a8 commit 5faaef3

File tree

1 file changed

+0
-32
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-32
lines changed

src/main/java/com/fishercoder/solutions/_671.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,6 @@
66
import java.util.Set;
77
import java.util.TreeSet;
88

9-
/**
10-
* 671. Second Minimum Node In a Binary Tree
11-
*
12-
* Given a non-empty special binary tree consisting of nodes with the non-negative value,
13-
* where each node in this tree has exactly two or zero sub-node.
14-
* If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes.
15-
* Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree.
16-
* If no such second minimum value exists, output -1 instead.
17-
18-
Example 1:
19-
20-
Input:
21-
2
22-
/ \
23-
2 5
24-
/ \
25-
5 7
26-
27-
Output: 5
28-
Explanation: The smallest value is 2, the second smallest value is 5.
29-
30-
Example 2:
31-
32-
Input:
33-
2
34-
/ \
35-
2 2
36-
37-
Output: -1
38-
Explanation: The smallest value is 2, but there isn't any second smallest value.
39-
40-
*/
419
public class _671 {
4210
public static class Solution1 {
4311
public int findSecondMinimumValue(TreeNode root) {

0 commit comments

Comments
 (0)