Skip to content

Commit 8f60321

Browse files
committed
docs: rename files
1 parent b1d4be7 commit 8f60321

File tree

3 files changed

+14
-40
lines changed

3 files changed

+14
-40
lines changed

DynamicProgramming/Edit_Distance.java renamed to DynamicProgramming/EditDistance.java

+8-33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package DynamicProgramming; /**
2-
* Author : SUBHAM SANGHAI
1+
package DynamicProgramming;
2+
3+
/**
34
* A DynamicProgramming based solution for Edit Distance problem In Java
45
* Description of Edit Distance with an Example:
56
* <p>
@@ -13,37 +14,13 @@
1314
* kitten → sitten (substitution of "s" for "k")
1415
* sitten → sittin (substitution of "i" for "e")
1516
* sittin → sitting (insertion of "g" at the end).
16-
* Description of Edit Distance with an Example:
17-
* <p>
18-
* Edit distance is a way of quantifying how dissimilar two strings (e.g., words) are to one another,
19-
* by counting the minimum number of operations required to transform one string into the other. The
20-
* distance operations are the removal, insertion, or substitution of a character in the string.
21-
* <p>
22-
* <p>
23-
* The Distance between "kitten" and "sitting" is 3. A minimal edit script that transforms the former into the latter is:
24-
* <p>
25-
* kitten → sitten (substitution of "s" for "k")
26-
* sitten → sittin (substitution of "i" for "e")
27-
* sittin → sitting (insertion of "g" at the end).
17+
*
18+
* @author SUBHAM SANGHAI
2819
**/
2920

30-
/**Description of Edit Distance with an Example:
31-
32-
Edit distance is a way of quantifying how dissimilar two strings (e.g., words) are to one another,
33-
by counting the minimum number of operations required to transform one string into the other. The
34-
distance operations are the removal, insertion, or substitution of a character in the string.
35-
36-
37-
The Distance between "kitten" and "sitting" is 3. A minimal edit script that transforms the former into the latter is:
38-
39-
kitten → sitten (substitution of "s" for "k")
40-
sitten → sittin (substitution of "i" for "e")
41-
sittin → sitting (insertion of "g" at the end).**/
42-
4321
import java.util.Scanner;
4422

45-
public class Edit_Distance {
46-
23+
public class EditDistance {
4724

4825
public static int minDistance(String word1, String word2) {
4926
int len1 = word1.length();
@@ -87,17 +64,15 @@ then take the minimum of the various operations(i.e insertion,removal,substituti
8764
}
8865

8966

90-
// Driver program to test above function
91-
public static void main(String args[]) {
67+
public static void main(String[] args) {
9268
Scanner input = new Scanner(System.in);
9369
String s1, s2;
9470
System.out.println("Enter the First String");
9571
s1 = input.nextLine();
9672
System.out.println("Enter the Second String");
9773
s2 = input.nextLine();
9874
//ans stores the final Edit Distance between the two strings
99-
int ans = 0;
100-
ans = minDistance(s1, s2);
75+
int ans = minDistance(s1, s2);
10176
System.out.println("The minimum Edit Distance between \"" + s1 + "\" and \"" + s2 + "\" is " + ans);
10277
}
10378
}

DynamicProgramming/Ford_Fulkerson.java renamed to DynamicProgramming/FordFulkerson.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import java.util.LinkedList;
44
import java.util.Queue;
5-
import java.util.Scanner;
65
import java.util.Vector;
76

8-
public class Ford_Fulkerson {
9-
Scanner scan = new Scanner(System.in);
7+
public class FordFulkerson {
108
final static int INF = 987654321;
11-
static int V; // edges
9+
// edges
10+
static int V;
1211
static int[][] capacity, flow;
1312

1413
public static void main(String[] args) {

Misc/heap_sort.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package Misc;
22

33
public class heap_sort {
4-
public void sort(int arr[]) {
4+
public void sort(int[] arr) {
55
int n = arr.length;
66

77
// Build heap (rearrange array)
@@ -22,7 +22,7 @@ public void sort(int arr[]) {
2222

2323
// To heapify a subtree rooted with node i which is
2424
// an index in arr[]. n is size of heap
25-
void heapify(int arr[], int n, int i) {
25+
void heapify(int[] arr, int n, int i) {
2626
int largest = i; // Initialize largest as root
2727
int l = 2 * i + 1; // left = 2*i + 1
2828
int r = 2 * i + 2; // right = 2*i + 2
@@ -47,7 +47,7 @@ void heapify(int arr[], int n, int i) {
4747
}
4848

4949
/* A utility function to print array of size n */
50-
static void printArray(int arr[]) {
50+
static void printArray(int[] arr) {
5151
int n = arr.length;
5252
for (int i = 0; i < n; ++i)
5353
System.out.print(arr[i] + " ");

0 commit comments

Comments
 (0)