Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ac8ad4

Browse files
format
1 parentecf5c68 commit0ac8ad4

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ Your ideas/fixes/algorithms are more than welcome!
407407
|167|[Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_167.java)| O(logn)|O(1)| Easy|
408408
|166|[Fraction to Recurring Decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_166.java) | O(1) |O(1) | Medium| HashMap
409409
|165|[Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_165.java)| O(n)|O(1)| Easy|
410-
|164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MaximumGap.java)| O(n)|O(n)| Hard|
410+
|164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_164.java)| O(n)|O(n)| Hard|
411411
|163|[Missing Ranges](https://leetcode.com/problems/missing-ranges/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MissingRanges.java)| O(n)|O(1)||
412412
|162|[Find Peak Element](https://leetcode.com/problems/find-peak-element/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_162.java)| O(1)|O(logn)/O(n)| Binary Search|
413413
|161|[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)|[Solution](../master/src/main/java/com/fishercoder/solutions/OneEditDistance.java)| O(n)|O(1)||

‎src/main/java/com/fishercoder/solutions/MaximumGap.javarenamed to‎src/main/java/com/fishercoder/solutions/_164.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55
/**
66
* Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
7-
* <p>
87
* Try to solve it in linear time/space.
9-
* <p>
108
* Return 0 if the array contains less than 2 elements.
11-
* <p>
129
* You may assume all elements in the array are non-negative integers and fit in the 32-bit signed integer range.
1310
*/
14-
publicclassMaximumGap {
11+
publicclass_164 {
1512
//brute force
1613
publicintmaximumGap(int[]nums) {
1714
if (nums.length <2)return0;

‎src/test/java/com/fishercoder/MaximumGapTest.javarenamed to‎src/test/java/com/fishercoder/_164Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
packagecom.fishercoder;
22

3-
importcom.fishercoder.solutions.MaximumGap;
3+
importcom.fishercoder.solutions._164;
44
importorg.junit.Before;
55
importorg.junit.BeforeClass;
66
importorg.junit.Test;
77

88
importstaticjunit.framework.Assert.assertEquals;
99

10-
publicclassMaximumGapTest {
11-
privatestaticMaximumGaptest;
10+
publicclass_164Test {
11+
privatestatic_164test;
1212
privatestaticintexpected;
1313
privatestaticintactual;
1414
privatestaticint[]nums;
1515

1616
@BeforeClass
1717
publicstaticvoidsetup(){
18-
test =newMaximumGap();
18+
test =new_164();
1919
}
2020

2121
@Before

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp