Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dynamic Programming/Fibonacci.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class Fibonacci {

public static Map<Integer,Integer> map = new HashMap<Integer,Integer>();
private static Map<Integer,Integer> map = new HashMap<Integer,Integer>();

public static void main(String[] args) throws Exception {

Expand All @@ -29,7 +29,7 @@ public static void main(String[] args) throws Exception {
* Outputs the nth fibonacci number
**/

public static int fibMemo(int n) {
private static int fibMemo(int n) {
if (map.containsKey(n)) {
return map.get(n);
}
Expand All @@ -54,7 +54,7 @@ public static int fibMemo(int n) {
* Outputs the nth fibonacci number
**/

public static int fibBotUp(int n) {
private static int fibBotUp(int n) {

Map<Integer,Integer> fib = new HashMap<Integer,Integer>();

Expand Down
4 changes: 2 additions & 2 deletions Dynamic Programming/Levenshtein_distance.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

public class Levenshtein_distance{
private int minimum(int a, int b, int c){
private static int minimum(int a, int b, int c){
if(a < b && a < c){
return a;
}else if(b < a && b < c){
Expand All @@ -16,7 +16,7 @@ private int minimum(int a, int b, int c){
return c;
}
}
public int calculate_distance(String a, String b){
private static int calculate_distance(String a, String b){
len_a = a.length() + 1;
len_b = b.length() + 1;
int [][] distance_mat = new int[len_a][len_b];
Expand Down
2 changes: 1 addition & 1 deletion Dynamic Programming/LongestIncreasingSubsequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private static int upperBound(int[] ar, int l, int r, int key) {
return r;
}

public static int LIS(int[] array) {
private static int LIS(int[] array) {
int N = array.length;
if (N == 0)
return 0;
Expand Down