This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Permutations | |
{ | |
public static void main (String[] args) | |
{ | |
if (args.length == 0 || args.length == 1) | |
{System.out.println("Not enough arguments supplied"); | |
System.exit(0);} | |
else if (args.length > 2) | |
{System.out.println("Too many arguments"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.PrintStream; | |
import java.io.IOException; | |
import java.io.File; | |
import java.util.Scanner; | |
import java.util.Random; | |
public class randInts | |
{ public static void main(String[] args) | |
{ try | |
{ PrintStream writer = new PrintStream( new File("randInts.txt")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class MinOccurance2 | |
{ | |
public static void main (String[] args) throws IOException | |
{ | |
int[] occur = new int[256]; | |
int Current = 0; | |
RandomAccessFile file = new RandomAccessFile("test.txt", "r"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThreadTest | |
{ | |
public static void main(String [] args) | |
{ | |
MyThread t1 = new MyThread(0); | |
MyThread t2 = new MyThread(0); | |
System.out.println("Time difference calculating 100000 prime numbers, single/multithreaded:"); | |
long start_time = System.nanoTime(); |