Skip to content

Commit 8235a58

Browse files
[LEET-0000] change names to match Leetcode updates
1 parent 890c630 commit 8235a58

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

leetcode-algorithms/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Algorithms
44
| # | Title | Solutions | Time | Space | Difficulty | Tag | Notes
55
|-----|----------------|---------------|---------------|---------------|-------------|--------------|-----
6-
|515|[Find Largest Element in Each Row](https://leetcode.com/problems/find-largest-element-in-each-row/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/FindLargestElementinEachRow.java) | O(n) |O(k) | Medium| BFS
7-
|513|[Find Left Most Element](https://leetcode.com/problems/find-left-most-element/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/FindLeftMostElement.java) | O(n) |O(k) | Medium| BFS
6+
|515|[Find Largest Value in Each Tree Row](https://leetcode.com/problems/find-largest-value-in-each-tree-row/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/FindLargestElementinEachRow.java) | O(n) |O(k) | Medium| BFS
7+
|513|[Find Bottom Left Tree Value](https://leetcode.com/problems/find-bottom-left-tree-value/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/FindBottomLeftValue.java) | O(n) |O(k) | Medium| BFS
88
|504|[Base 7](https://leetcode.com/problems/base-7/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/Base7.java) | O(1) |O(1) | Easy|
99
|501|[Find Mode in Binary Tree](https://leetcode.com/problems/find-mode-in-binary-tree/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/FindModeinBinaryTree.java) | O(n) |O(k) | Easy| Binary Tree
1010
|492|[Construct the Rectangle](https://leetcode.com/problems/construct-the-rectangle/)|[Solution](../../master/leetcode-algorithms/src/main/java/com/stevesun/solutions/ConstructTheRectangle.java) | O(n) |O(1) | Easy| Array

leetcode-algorithms/src/main/java/com/stevesun/solutions/Base7.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public class Base7 {
1616

17-
public String convertTo7(int num) {
17+
public String convertToBase7(int num) {
1818
return String.valueOf(Integer.toString(num, 7));
1919
}
2020
}

leetcode-algorithms/src/main/java/com/stevesun/solutions/FindLeftMostElement.java renamed to leetcode-algorithms/src/main/java/com/stevesun/solutions/FindBottomLeftValue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
7
3434
Note: You may assume the tree (i.e., the given root node) is not NULL.
3535
*/
36-
public class FindLeftMostElement {
36+
public class FindBottomLeftValue {
3737

38-
public int findLeftMostNode(TreeNode root) {
38+
public int findBottomLeftValue(TreeNode root) {
3939
Queue<TreeNode> queue = new LinkedList<>();
4040
queue.offer(root);
4141
TreeNode leftMost = root;

leetcode-algorithms/src/main/java/com/stevesun/solutions/FindLargestElementinEachRow.java renamed to leetcode-algorithms/src/main/java/com/stevesun/solutions/FindLargestValueinEachTreeRow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
2222
Output: [1, 3, 9]
2323
*/
24-
public class FindLargestElementinEachRow {
24+
public class FindLargestValueinEachTreeRow {
2525

26-
public int[] findValueMostElement(TreeNode root) {
26+
public int[] largestValues(TreeNode root) {
2727
Queue<TreeNode> queue = new LinkedList<>();
2828
if (root != null) {
2929
queue.offer(root);

leetcode-algorithms/src/test/java/com/stevesun/Base7Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ public void setupForEachTest(){
3232
public void test1(){
3333
num = 100;
3434
expected = "202";
35-
actual = test.convertTo7(num);
35+
actual = test.convertToBase7(num);
3636
assertEquals(expected, actual);
3737
}
3838

3939
@Test
4040
public void test2(){
4141
num = -7;
4242
expected = "-10";
43-
actual = test.convertTo7(num);
43+
actual = test.convertToBase7(num);
4444
assertEquals(expected, actual);
4545
}
4646
}

leetcode-algorithms/src/test/java/com/stevesun/FindLeftMostElementTest.java renamed to leetcode-algorithms/src/test/java/com/stevesun/FindBottomLeftValueTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.stevesun;
22

33
import com.stevesun.common.classes.TreeNode;
4-
import com.stevesun.solutions.FindLeftMostElement;
4+
import com.stevesun.solutions.FindBottomLeftValue;
55
import org.junit.Before;
66
import org.junit.BeforeClass;
77
import org.junit.Test;
@@ -11,15 +11,15 @@
1111
/**
1212
* Created by stevesun on 1/15/17.
1313
*/
14-
public class FindLeftMostElementTest {
15-
private static FindLeftMostElement test;
14+
public class FindBottomLeftValueTest {
15+
private static FindBottomLeftValue test;
1616
private static int expected;
1717
private static int actual;
1818
private static TreeNode root;
1919

2020
@BeforeClass
2121
public static void setup(){
22-
test = new FindLeftMostElement();
22+
test = new FindBottomLeftValue();
2323
}
2424

2525
@Before
@@ -35,7 +35,7 @@ public void test1(){
3535
root.left = new TreeNode(1);
3636
root.right= new TreeNode(3);
3737
expected = 1;
38-
actual = test.findLeftMostNode(root);
38+
actual = test.findBottomLeftValue(root);
3939
assertEquals(expected, actual);
4040

4141
}
@@ -50,7 +50,7 @@ public void test2(){
5050
root.right.right= new TreeNode(6);
5151
root.right.left.left= new TreeNode(7);
5252
expected = 7;
53-
actual = test.findLeftMostNode(root);
53+
actual = test.findBottomLeftValue(root);
5454
assertEquals(expected, actual);
5555
}
5656
}

leetcode-algorithms/src/test/java/com/stevesun/FindLargestElementinEachRowTest.java renamed to leetcode-algorithms/src/test/java/com/stevesun/FindLargestValueinEachTreeRowTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package com.stevesun;
22

33
import com.stevesun.common.classes.TreeNode;
4-
import com.stevesun.solutions.FindLargestElementinEachRow;
4+
import com.stevesun.solutions.FindLargestValueinEachTreeRow;
55
import org.junit.Before;
66
import org.junit.BeforeClass;
77
import org.junit.Test;
88

99
import static org.junit.Assert.assertArrayEquals;
1010

11-
public class FindLargestElementinEachRowTest {
12-
private static FindLargestElementinEachRow test;
11+
public class FindLargestValueinEachTreeRowTest {
12+
private static FindLargestValueinEachTreeRow test;
1313
private static int[] expected;
1414
private static int[] actual;
1515
private static TreeNode root;
1616

1717
@BeforeClass
1818
public static void setup(){
19-
test = new FindLargestElementinEachRow();
19+
test = new FindLargestValueinEachTreeRow();
2020
}
2121

2222
@Before
@@ -32,15 +32,15 @@ public void test1(){
3232
root.left = new TreeNode(3);
3333
root.right= new TreeNode(2);
3434
expected = new int[]{1, 3};
35-
actual = test.findValueMostElement(root);
35+
actual = test.largestValues(root);
3636
assertArrayEquals(expected, actual);
3737

3838
}
3939

4040
@Test
4141
public void test2(){
4242
expected = new int[]{};
43-
actual = test.findValueMostElement(null);
43+
actual = test.largestValues(null);
4444
assertArrayEquals(expected, actual);
4545

4646
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy