Skip to content

Commit 3865ba4

Browse files
committed
Added links for explanation of DFS and Monotonic Array algorithms
1 parent 9064a20 commit 3865ba4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

DFSrecursive.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* This is a recursive implementation of the Depth-First Search (DFS) algorithm.
3+
* DFS explores as far as possible along each branch before backtracking.
4+
*
5+
* For more details, refer to:
6+
* https://en.wikipedia.org/wiki/Depth-first_search
7+
*/
8+
19
import java.util.Arrays;
210

311
public class DFSrecursive {

MonotonicArray.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* This function checks if an array is monotonic.
3+
* An array is monotonic if it is either entirely non-increasing or non-decreasing.
4+
*
5+
* For more details, refer to:
6+
* https://leetcode.com/problems/monotonic-array/
7+
*/
8+
19
package CIS_Github;
210
import java.util.List;
311

@@ -9,7 +17,7 @@
917
Example: [4,2,8,7] (Neither always increasing nor decreasing) {False}
1018
*/
1119

12-
public class Mono {
20+
public class MonotonicArray {
1321
//Function to test if list is monotonic
1422
public static boolean isMonotonic(List<Integer> nums) {
1523
//Checks that list is always increasing

0 commit comments

Comments
 (0)