GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fd · Tulpen/Leetcode-Java@d84dfa1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Leetcode-Java.iml
  • amazon
    • amazon.iml
  • facebook
    • facebook.iml
  • google
    • google.iml
    • src/main/java/com/leetcode/google
      • Main.java
      • PathSumIII.java
      • RecoverBinarySearchTree.java
  • gradle/wrapper
    • gradle-wrapper.properties
  • library
    • library.iml
  • settings.gradle
  • solution
    • solution.iml
    • src/main/java/com/inuker/solution
      • AddTwoNumber.java
      • AddTwoNumbersII.java
      • BinaryTreeInorderTraversal.java
      • ConvertSortedListToBinarySearchTree.java
      • DeleteNodeInALinkedList.java
      • InsertionSortList.java
      • IntersectionOfTwoLinkedLists.java
      • KthSmallestElementInBST.java
      • LinkedListCycle.java
      • LinkedListCycleII.java
      • LinkedListRandomNode.java
      • MergeKSortedList.java
      • MergeTwoSortedList.java
      • OddEvenLinkedList.java
      • PalindromeLinkedList.java
      • PartitionList.java
      • PlusOneLinkedList.java
      • RecoverBinarySearchTree.java
      • RemoveDuplicatesFromSortedList.java
      • RemoveDuplicatesFromSortedListII.java
      • RemoveLinkedListElements.java
      • RemoveNthNodeFromEndOfList.java
      • ReorderList.java
      • ReverseLinkedList.java
      • ReverseLinkedListII.java
      • ReverseNodesInKGroup.java
      • RotateList.java
      • SortList.java
      • SwapNodesInPairs.java
  • test
    • .gitignore
    • build.gradle
    • src/main/java/com/inuker/test
      • main.java
    • test.iml
  • tools
    • tools.iml

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Leetcode-Java.iml‎

Copy file name to clipboard
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="Leetcode-Java" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="inheritedJdk" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>
Collapse file

‎amazon/amazon.iml‎

Copy file name to clipboardExpand all lines: amazon/amazon.iml
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
</configuration>
1414
</facet>
1515
</component>
16-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
17-
<output url="file://$MODULE_DIR$/build/classes/main" />
18-
<output-test url="file://$MODULE_DIR$/build/classes/test" />
16+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
17+
<output url="file://$MODULE_DIR$/build/classes/java/main" />
18+
<output-test url="file://$MODULE_DIR$/build/classes/java/test" />
1919
<exclude-output />
2020
<content url="file://$MODULE_DIR$">
2121
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
@@ -28,5 +28,6 @@
2828
<orderEntry type="inheritedJdk" />
2929
<orderEntry type="sourceFolder" forTests="false" />
3030
<orderEntry type="module" module-name="library" exported="" />
31+
<orderEntry type="module" module-name="library" exported="" />
3132
</component>
3233
</module>
Collapse file

‎facebook/facebook.iml‎

Copy file name to clipboardExpand all lines: facebook/facebook.iml
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
</configuration>
1414
</facet>
1515
</component>
16-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
17-
<output url="file://$MODULE_DIR$/build/classes/main" />
18-
<output-test url="file://$MODULE_DIR$/build/classes/test" />
16+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
17+
<output url="file://$MODULE_DIR$/build/classes/java/main" />
18+
<output-test url="file://$MODULE_DIR$/build/classes/java/test" />
1919
<exclude-output />
2020
<content url="file://$MODULE_DIR$">
2121
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
@@ -28,5 +28,6 @@
2828
<orderEntry type="inheritedJdk" />
2929
<orderEntry type="sourceFolder" forTests="false" />
3030
<orderEntry type="module" module-name="library" exported="" />
31+
<orderEntry type="module" module-name="library" exported="" />
3132
</component>
3233
</module>
Collapse file

‎google/google.iml‎

Copy file name to clipboardExpand all lines: google/google.iml
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
</configuration>
1414
</facet>
1515
</component>
16-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
17-
<output url="file://$MODULE_DIR$/build/classes/main" />
18-
<output-test url="file://$MODULE_DIR$/build/classes/test" />
16+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
17+
<output url="file://$MODULE_DIR$/build/classes/java/main" />
18+
<output-test url="file://$MODULE_DIR$/build/classes/java/test" />
1919
<exclude-output />
2020
<content url="file://$MODULE_DIR$">
2121
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
@@ -28,5 +28,6 @@
2828
<orderEntry type="inheritedJdk" />
2929
<orderEntry type="sourceFolder" forTests="false" />
3030
<orderEntry type="module" module-name="library" exported="" />
31+
<orderEntry type="module" module-name="library" exported="" />
3132
</component>
3233
</module>
Collapse file

‎google/src/main/java/com/leetcode/google/Main.java‎

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.leetcode.google;
2+
3+
/**
4+
* Created by liwentian on 2017/11/29.
5+
*/
6+
7+
public class Main {
8+
9+
public static void Main(String[] args) {
10+
}
11+
}
Collapse file

‎google/src/main/java/com/leetcode/google/PathSumIII.java‎

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.leetcode.google;
2+
3+
import com.leetcode.library.TreeNode;
4+
5+
/**
6+
* Created by liwentian on 2017/11/29.
7+
*/
8+
9+
public class PathSumIII {
10+
11+
public int pathSum(TreeNode root, int sum) {
12+
int[] count = new int[1];
13+
helperSum(root, sum, count);
14+
return count[0];
15+
}
16+
17+
private void helperSum(TreeNode root, int sum, int[] count) {
18+
if (root == null) {
19+
return;
20+
}
21+
helper(root, sum, count);
22+
helperSum(root.left, sum, count);
23+
helperSum(root.right, sum, count);
24+
}
25+
26+
private void helper(TreeNode root, int sum, int[] count) {
27+
if (root == null) {
28+
return;
29+
}
30+
if (root.val == sum) {
31+
count[0]++;
32+
}
33+
helper(root.left, sum - root.val, count);
34+
helper(root.right, sum - root.val, count);
35+
}
36+
}
Collapse file

‎google/src/main/java/com/leetcode/google/RecoverBinarySearchTree.java‎

Copy file name to clipboard
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.leetcode.google;
2+
3+
import com.leetcode.library.TreeNode;
4+
5+
import java.util.Stack;
6+
7+
/**
8+
* Created by liwentian on 2017/11/29.
9+
*/
10+
11+
public class RecoverBinarySearchTree {
12+
13+
public void recoverTree(TreeNode root) {
14+
Stack<TreeNode> stack = new Stack<>();
15+
TreeNode prev = null, first = null, second = null;
16+
17+
while (!stack.isEmpty() || root != null) {
18+
if (root != null) {
19+
stack.push(root);
20+
root = root.left;
21+
} else {
22+
root = stack.pop();
23+
24+
if (prev != null) {
25+
if (first == null && prev.val > root.val) {
26+
first = prev;
27+
}
28+
if (first != null && prev.val > root.val) {
29+
second = root;
30+
}
31+
}
32+
prev = root;
33+
root = root.right;
34+
}
35+
}
36+
37+
int t = first.val;
38+
first.val = second.val;
39+
second.val = t;
40+
}
41+
}
Collapse file

‎gradle/wrapper/gradle-wrapper.properties‎

Copy file name to clipboardExpand all lines: gradle/wrapper/gradle-wrapper.properties
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip
Collapse file

‎library/library.iml‎

Copy file name to clipboardExpand all lines: library/library.iml
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
</configuration>
1414
</facet>
1515
</component>
16-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
17-
<output url="file://$MODULE_DIR$/build/classes/main" />
18-
<output-test url="file://$MODULE_DIR$/build/classes/test" />
16+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
17+
<output url="file://$MODULE_DIR$/build/classes/java/main" />
18+
<output-test url="file://$MODULE_DIR$/build/classes/java/test" />
1919
<exclude-output />
2020
<content url="file://$MODULE_DIR$">
2121
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
Collapse file

‎settings.gradle‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':app', ':solution', ':google', ':library', ':facebook', ':amazon', ':tools'
1+
include ':app', ':solution', ':google', ':library', ':facebook', ':amazon', ':tools', ':test'

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.