Skip to content

Commit 46fa50b

Browse files
Merge pull request #25 from zacharyjones123/master
JavaDoc and No Spaces in File Names
2 parents 5105464 + 3714ffe commit 46fa50b

30 files changed

+1113
-460
lines changed

.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry excluding="data_structures/" kind="src" path=""/>
4+
<classpathentry kind="src" path="data_structures"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Java</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
File renamed without changes.

Binary to Decimal.java renamed to BinaryToDecimal.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
#import java.util.*;
2-
class Binary_Decimal
1+
import java.util.Scanner;
2+
3+
/**
4+
* This class converts a Binary number to a Decimal number
5+
*
6+
* @author Unknown
7+
*
8+
*/
9+
class BinaryToDecimal
310
{
11+
12+
/**
13+
* Main Method
14+
*
15+
* @param args Command line arguments
16+
*/
417
public static void main(String args[])
518
{
619
Scanner sc=new Scanner(System.in);

Bubble Sort.java renamed to BubbleSort.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import java.util.Scanner;
22

3+
/**
4+
* This class implements BubbleSort
5+
*
6+
* @author Unknown
7+
*
8+
*/
9+
310
class BubbleSort
411
{
12+
/**
13+
* Main Method
14+
*
15+
* @param args Command line arguments
16+
*/
517
public static void main(String[] args)
618
{
719
int array[]=new int[6];

Decimal to Binary.java renamed to DecimalToBinary.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
#import java.util.*;
2-
class Decimal_Binary
1+
import java.util.Scanner;
2+
3+
/**
4+
* This class converts a Decimal number to a Binary number
5+
*
6+
* @author Unknown
7+
*
8+
*/
9+
class DecimalToBinary
310
{
11+
/**
12+
* Main Method
13+
*
14+
* @param args Command Line Arguments
15+
*/
416
public static void main(String args[])
517
{
618
Scanner sc=new Scanner(System.in);

Decimal to octal.java renamed to DecimalToOctal.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
#import java.util.*;
1+
import java.util.Scanner;
2+
3+
/**
4+
* This class converts Decimal numbers to Octal Numbers
5+
*
6+
* @author Unknown
7+
*
8+
*/
29
class Decimal_Octal
310
{
4-
public static void main()
11+
/**
12+
* Main Method
13+
*
14+
* @param args Command line Arguments
15+
*/
16+
public static void main(String[] args)
517
{
618
Scanner sc=new Scanner(System.in);
719
int n,k,d,s=0,c=0;

Factorial.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import java.util.Scanner;
22

3+
/**
4+
* This program will print out the factorial of any non-negative
5+
* number that you input into it.
6+
*
7+
* @author Unknown
8+
*
9+
*/
310
public class Factorial{
411

12+
/**
13+
* The main method
14+
*
15+
* @param args Command line arguments
16+
*/
517
public static void main(String[] args){
618
Scanner input = new Scanner(System.in);
719
//Prompt user to enter integer
@@ -20,7 +32,12 @@ public static void main(String[] args){
2032
}
2133
}
2234

23-
//Factorial method
35+
/**
36+
* Recursive Factorial Method
37+
*
38+
* @param n The number to factorial
39+
* @return The factorial of the number
40+
*/
2441
public static long factorial(int n){
2542

2643
if (n==0){

FindingPrimes.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
/*
2-
* The Sieve of Eratosthenes is an algorithm used to find prime numbers, up to a given value.
1+
/**
2+
* The Sieve of Eratosthenes is an algorithm use to find prime numbers,
3+
* up to a given value.
34
* Illustration: https://upload.wikimedia.org/wikipedia/commons/b/b9/Sieve_of_Eratosthenes_animation.gif
4-
*/
5+
* (This illustration is also in the github repository)
6+
*
7+
* @author Unknown
8+
*
9+
*/
510
public class FindingPrimes{
11+
/**
12+
* The Main method
13+
*
14+
* @param args Command line arguments
15+
*/
616
public static void main(String args[]){
717
SOE(20); //Example: Finds all the primes up to 20
818
}
919

20+
/**
21+
* The method implementing the Sieve of Eratosthenes
22+
*
23+
* @param n Number to perform SOE on
24+
*/
1025
public static void SOE(int n){
1126
boolean sieve[] = new boolean[n];
1227

0 commit comments

Comments
 (0)