Skip to content

Commit 837f4d7

Browse files
committed
overhaul
object orientified, sound and visual overhaul
1 parent aedbe7d commit 837f4d7

22 files changed

+1075
-712
lines changed

dist/Array_Visualizer.jar

19.2 KB
Binary file not shown.

src/Analysis.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* To change this template, choose Tools | Templates
3+
* and open the template in the editor.
4+
*/
5+
package array.visualizer;
6+
7+
import static array.visualizer.ArrayVisualizer.*;
8+
9+
/**
10+
*
11+
* @author S630690
12+
*/
13+
public class Analysis {
14+
public static int analyze(int base)throws Exception {
15+
int a = 0;
16+
for(int i = 0; i < array.length; i++){
17+
marked.set(1, i);
18+
aa++;
19+
sleep(1);
20+
if((int)(Math.log(array[i])/Math.log(base))>a){
21+
a=(int)(Math.log(array[i])/Math.log(base));
22+
}
23+
}
24+
return a;
25+
}
26+
27+
public static int analyze(int[] ar, int base) {
28+
int a = 0;
29+
for(int i = 0; i < ar.length; i++)
30+
if((int)(Math.log(ar[i])/Math.log(base))>a){
31+
a=(int)(Math.log(ar[i])/Math.log(base));
32+
}
33+
return a;
34+
}
35+
36+
public static int analyzemax() throws Exception{
37+
int a = 0;
38+
for(int i = 0; i < array.length; i++){
39+
if(array[i]>a)
40+
a=array[i];
41+
marked.set(1,i);
42+
aa++;
43+
sleep(1);
44+
}
45+
return a;
46+
}
47+
}

0 commit comments

Comments
 (0)