Merge pull request #276 from KennethNero/Comments&Fixes

Comments&fixes
This commit is contained in:
Chetan Kaushik 2017-10-27 14:41:31 +05:30 committed by GitHub
commit 60275e9b22
13 changed files with 13 additions and 24 deletions

View File

@ -17,8 +17,8 @@ public class Levenshtein_distance{
} }
} }
private static int calculate_distance(String a, String b){ private static int calculate_distance(String a, String b){
len_a = a.length() + 1; int len_a = a.length() + 1;
len_b = b.length() + 1; int len_b = b.length() + 1;
int [][] distance_mat = new int[len_a][len_b]; int [][] distance_mat = new int[len_a][len_b];
for(int i = 0; i < len_a; i++){ for(int i = 0; i < len_a; i++){
distance_mat[i][0] = i; distance_mat[i][0] = i;

View File

@ -2,8 +2,7 @@
Returns the best obtainable price for a rod of Returns the best obtainable price for a rod of
length n and price[] as prices of different pieces */ length n and price[] as prices of different pieces */
public class RodCutting public class RodCutting {
{
private static int cutRod(int price[],int n) private static int cutRod(int price[],int n)
{ {

View File

@ -12,6 +12,6 @@ class Abecedarian{
else{return false;} else{return false;}
} }
}
return true; return true;
} }
}

View File

@ -4,6 +4,11 @@
*/ */
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class Solution { public class Solution {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {

View File

@ -1,4 +1,3 @@
package factorial;
import java.util.Scanner; import java.util.Scanner;
/** /**

View File

@ -1,6 +1,5 @@
import java.util.Scanner; import java.util.Scanner;
public class FloydTriangle { public class FloydTriangle {
public static void main(String[] args) { public static void main(String[] args) {
Scanner sc = new Scanner(System.in); Scanner sc = new Scanner(System.in);

View File

@ -67,8 +67,4 @@ public class ReverseStackUsingRecursion {
} }
} }

View File

@ -39,7 +39,7 @@ class ReverseString
BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the string"); System.out.println("Enter the string");
String srr=br.readLine(); String srr=br.readLine();
System.out.println("Reverse="+reverseString(srr)); System.out.println("Reverse="+reverse(srr));
br.close(); br.close();
} }
} }

View File

@ -1,4 +1,5 @@
import java.util.Scanner; import java.util.Scanner;
class krishnamurthy class krishnamurthy
{ {
int fact(int n) int fact(int n)

View File

@ -1,8 +1,4 @@
import java.io.*;
import java.util.*; import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution { public class Solution {

View File

@ -1,5 +1,3 @@
import java.io.*;
import java.util.*; import java.util.*;
class Radix { class Radix {

View File

@ -1,9 +1,7 @@
// A Java program for Prim's Minimum Spanning Tree (MST) algorithm. // A Java program for Prim's Minimum Spanning Tree (MST) algorithm.
//adjacency matrix representation of the graph //adjacency matrix representation of the graph
import java.util.*;
import java.lang.*; import java.lang.*;
import java.io.*;
class PrimMST class PrimMST
{ {

View File

@ -1,5 +1,3 @@
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;