Skip to content

Commit 2a1fc02

Browse files
committed
Many quality of code changes
Removing unused imports, cleaning up (at a base level) code, and removing some package declarations. By no means did I get all of them.
1 parent a0fd638 commit 2a1fc02

18 files changed

+954
-24
lines changed

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 908 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dynamic Programming/Levenshtein_distance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ private static int minimum(int a, int b, int c){
1717
}
1818
}
1919
private static int calculate_distance(String a, String b){
20-
len_a = a.length() + 1;
21-
len_b = b.length() + 1;
20+
int len_a = a.length() + 1;
21+
int len_b = b.length() + 1;
2222
int [][] distance_mat = new int[len_a][len_b];
2323
for(int i = 0; i < len_a; i++){
2424
distance_mat[i][0] = i;

Dynamic Programming/rod_cutting.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
Returns the best obtainable price for a rod of
33
length n and price[] as prices of different pieces */
44

5-
public class RodCutting
6-
{
5+
public class RodCutting {
76

87
private static int cutRod(int price[],int n)
98
{

Java.iml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager">
4+
<output url="file://$MODULE_DIR$/bin" />
5+
<exclude-output />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/data_structures" isTestSource="false" />
9+
</content>
10+
<orderEntry type="sourceFolder" forTests="false" />
11+
<orderEntry type="inheritedJdk" />
12+
</component>
13+
</module>

Others/Abecedarian.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ public static boolean isAbecedarian(String s){
1212

1313
else{return false;}
1414
}
15-
}
1615
return true;
16+
}
1717
}

Others/Dijkshtra.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
*/
55

66

7+
import java.io.IOException;
8+
import java.util.Arrays;
9+
import java.util.Scanner;
10+
import java.util.Stack;
11+
712
public class Solution {
813

914
public static void main(String[] args) throws IOException {
@@ -30,7 +35,7 @@ public static void main(String[] args) throws IOException {
3035

3136
//Implementing Dijkshtra's Algorithm
3237

33-
Stack <Integer> t=new Stack<Integer>();
38+
Stack<Integer> t=new Stack<Integer>();
3439
int src=in.nextInt();
3540
for(int i=1;i<=n;i++){
3641
if(i!=src){t.push(i);}}

Others/Factorial.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
package factorial;
21
import java.util.Scanner;
32

43
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy