File tree Expand file tree Collapse file tree 11 files changed +28
-36
lines changed
src/main/java/com/williamfiset/algorithms Expand file tree Collapse file tree 11 files changed +28
-36
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* Problem: https://leetcode.com/problems/house-robber
3
3
*
4
- * <p>Time Complexity: O(n) Space Complexity: O(n)
4
+ * <p>Time Complexity: O(n), space Complexity: O(n)
5
5
*
6
6
* <p>Download the code: $ git clone https://github.com/williamfiset/Algorithms
7
7
*
8
- * <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
8
+ * <p>Change directory to the root of the Algorithms directory:
9
+ * <p> $ cd Algorithms
9
10
*
10
- * <p>Build: $ javac com/williamfiset/algorithms/dp/examples/HouseRobber.java
11
+ * <p>Build: $ javac -d src/main/java src/main/java/ com/williamfiset/algorithms/dp/examples/HouseRobber.java
11
12
*
12
- * <p>Run: $ java com/williamfiset/algorithms/dp/examples/HouseRobber
13
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/dp/examples/HouseRobber
13
14
*/
14
15
package com .williamfiset .algorithms .dp .examples ;
15
16
Original file line number Diff line number Diff line change 6
6
*
7
7
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
8
8
*
9
- * <p>Compile: $ javac com/williamfiset/algorithms/graphtheory/examples/EagerPrimsExample.java
9
+ * <p>Compile: $ javac -d src/main/java src/main/java/ com/williamfiset/algorithms/graphtheory/examples/EagerPrimsExample.java
10
10
*
11
- * <p>Run: $ java com/williamfiset/algorithms/graphtheory/examples/EagerPrimsExample
11
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/examples/EagerPrimsExample
12
12
*
13
13
* <p>Time Complexity: O(ElogV)
14
14
*
Original file line number Diff line number Diff line change 9
9
*
10
10
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
11
11
*
12
- * <p>Build: $ javac
13
- * src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/CapacityScalingExample.java
12
+ * <p>Build: $ javac src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/CapacityScalingExample.java
14
13
*
15
- * <p>Run: $ java -cp src/main/java/
16
- * com/williamfiset/algorithms/graphtheory/networkflow/examples/CapacityScalingExample
14
+ * <p>Run: $ java -cp src/main/java/ com/williamfiset/algorithms/graphtheory/networkflow/examples/CapacityScalingExample
17
15
*/
18
16
package com .williamfiset .algorithms .graphtheory .networkflow .examples ;
19
17
Original file line number Diff line number Diff line change 8
8
*
9
9
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
10
10
*
11
- * <p>Build: $ javac
12
- * src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/DinicsExample.java
11
+ * <p>Build: $ javac -d src/main/java src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/DinicsExample.java
13
12
*
14
- * <p>Run: $ java -cp src/main/java/
15
- * com/williamfiset/algorithms/graphtheory/networkflow/examples/DinicsExample
13
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/networkflow/examples/DinicsExample
16
14
*/
17
15
package com .williamfiset .algorithms .graphtheory .networkflow .examples ;
18
16
Original file line number Diff line number Diff line change 7
7
*
8
8
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
9
9
*
10
- * <p>Build: $ javac
11
- * src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/EdmondsKarpExample.java
10
+ * <p>Build: $ javac -d src/main/java src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/EdmondsKarpExample.java
12
11
*
13
- * <p>Run: $ java -cp src/main/java/
14
- * com/williamfiset/algorithms/graphtheory/networkflow/examples/EdmondsKarpExample
12
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/networkflow/examples/EdmondsKarpExample
15
13
*/
16
14
package com .williamfiset .algorithms .graphtheory .networkflow .examples ;
17
15
Original file line number Diff line number Diff line change 8
8
*
9
9
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
10
10
*
11
- * <p>Build: $ javac
12
- * src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/FordFulkersonExample.java
11
+ * <p>Build: $ javac -d src/main/java src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/FordFulkersonExample.java
13
12
*
14
- * <p>Run: $ java -cp src/main/java/
15
- * com/williamfiset/algorithms/graphtheory/networkflow/examples/FordFulkersonExample
13
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/networkflow/examples/FordFulkersonExample
16
14
*/
17
15
package com .williamfiset .algorithms .graphtheory .networkflow .examples ;
18
16
Original file line number Diff line number Diff line change 3
3
*
4
4
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
5
5
*
6
- * <p>Build: $ javac
7
- * src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/MiceAndOwls.java
6
+ * <p>Build: $ javac -d src/main/java src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/examples/MiceAndOwls.java
8
7
*
9
- * <p>Run: $ java -cp src/main/java/
10
- * com/williamfiset/algorithms/graphtheory/networkflow/examples/MiceAndOwls
8
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/networkflow/examples/MiceAndOwls
11
9
*/
12
10
package com .williamfiset .algorithms .graphtheory .networkflow .examples ;
13
11
Original file line number Diff line number Diff line change 5
5
*
6
6
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
7
7
*
8
- * <p>Compile: $ javac
9
- * com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeHeight.java
8
+ * <p>Compile: $ javac -d src/main/java src/main/java/com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeHeight.java
10
9
*
11
- * <p>Run: $ java com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeHeight
10
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeHeight
12
11
*
13
12
* <p>Time Complexity: O(n)
14
13
*
Original file line number Diff line number Diff line change 5
5
*
6
6
* <p>Change directory to the root of the Algorithms directory: $ cd Algorithms
7
7
*
8
- * <p>Compile: $ javac com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeSum.java
8
+ * <p>Compile: $ javac -d src/main/java src/main/java/ com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeSum.java
9
9
*
10
- * <p>Run: $ java com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeSum
10
+ * <p>Run: $ java -cp src/main/java com/williamfiset/algorithms/graphtheory/treealgorithms/examples/TreeSum
11
11
*
12
12
* <p>Time Complexity: O(n)
13
13
*
Original file line number Diff line number Diff line change 7
7
*
8
8
* <p>Time Complexity: ~O(nloglogn)
9
9
*
10
- * <p>Compile: javac com/williamfiset/algorithms/math/CompressedPrimeSieve.java
10
+ * <p>Compile: javac -d src/main/java src/main/java/ com/williamfiset/algorithms/math/CompressedPrimeSieve.java
11
11
*
12
- * <p>Run: java com/williamfiset/algorithms/math/CompressedPrimeSieve
12
+ * <p>Run: java -cp src/main/java com/williamfiset/algorithms/math/CompressedPrimeSieve
13
13
*
14
14
* @author William Fiset, [email protected]
15
15
*/
You can’t perform that action at this time.
0 commit comments