Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8f60321

Browse files
committed
docs: rename files
1 parentb1d4be7 commit8f60321

File tree

3 files changed

+14
-40
lines changed

3 files changed

+14
-40
lines changed

‎DynamicProgramming/Edit_Distance.javarenamed to‎DynamicProgramming/EditDistance.java

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
packageDynamicProgramming;/**
2-
* Author : SUBHAM SANGHAI
1+
packageDynamicProgramming;
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
importjava.util.Scanner;
4422

45-
publicclassEdit_Distance {
46-
23+
publicclassEditDistance {
4724

4825
publicstaticintminDistance(Stringword1,Stringword2) {
4926
intlen1 =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-
publicstaticvoidmain(Stringargs[]) {
67+
publicstaticvoidmain(String[]args) {
9268
Scannerinput =newScanner(System.in);
9369
Strings1,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-
intans =0;
100-
ans =minDistance(s1,s2);
75+
intans =minDistance(s1,s2);
10176
System.out.println("The minimum Edit Distance between\"" +s1 +"\" and\"" +s2 +"\" is " +ans);
10277
}
10378
}

‎DynamicProgramming/Ford_Fulkerson.javarenamed to‎DynamicProgramming/FordFulkerson.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

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

8-
publicclassFord_Fulkerson {
9-
Scannerscan =newScanner(System.in);
7+
publicclassFordFulkerson {
108
finalstaticintINF =987654321;
11-
staticintV;// edges
9+
// edges
10+
staticintV;
1211
staticint[][]capacity,flow;
1312

1413
publicstaticvoidmain(String[]args) {

‎Misc/heap_sort.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
packageMisc;
22

33
publicclassheap_sort {
4-
publicvoidsort(intarr[]) {
4+
publicvoidsort(int[]arr) {
55
intn =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-
voidheapify(intarr[],intn,inti) {
25+
voidheapify(int[]arr,intn,inti) {
2626
intlargest =i;// Initialize largest as root
2727
intl =2 *i +1;// left = 2*i + 1
2828
intr =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-
staticvoidprintArray(intarr[]) {
50+
staticvoidprintArray(int[]arr) {
5151
intn =arr.length;
5252
for (inti =0;i <n; ++i)
5353
System.out.print(arr[i] +" ");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp