Skip to content

Instantly share code, notes, and snippets.

View OneRaynyDay's full-sized avatar

Ray Zhang OneRaynyDay

View GitHub Profile
@OneRaynyDay
OneRaynyDay / Main
Last active August 29, 2015 14:09
Shell Sort
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Random;
public class Foothill {
public static final int ARRAY_SIZE = 1000000;
public static void main(String[] args) {
Integer[] arrayOfInts1 = new Integer[ARRAY_SIZE];
import java.util.ArrayList;
public class Console {
protected String[] ENTRY = {"Latitude", "Longitude", "City", "State"};
public Console(){ /*empty on purpose*/ }
public void run(){
DataHandler function = new DataHandler("Coordinate.xml");
import java.text.NumberFormat;
import java.util.Locale;
//------------------------------------------------------
public class Main {
final static int MAT_SIZE = 50;
// ------- proof of correctness --------------
public static void main(String[] args) throws Exception {
int r, randRow, randCol;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
public class DataParser {
public final static int XML_FORMAT = 1;
public final static int CSV_FORMAT = 2;
//stub for extended class
public final static int JSON_FORMAT = 3;
private String iString;
private Destructurer init;
private String iRoot;
package cs_1c;
//class EBookEntry -----------------------------------------------------
public class EBookEntry implements Comparable<EBookEntry>
{
private String title, creator, subject;
private int eTextNum;
public static final int MIN_STRING = 1;
public static final int MAX_STRING = 300;
package cs_1c;
import java.util.*;
public class FHhashSC<E>
{
static final int INIT_TABLE_SIZE = 97;
static final double INIT_MAX_LAMBDA = 1.5;
protected FHlinkedList<E>[] mLists;
protected int mSize;
package cs_1c;
public class FHs_treeNode<E extends Comparable< ? super E > >
{
// use public access so the tree or other classes can access members
public FHs_treeNode<E> lftChild, rtChild;
public E data;
public FHs_treeNode<E> myRoot; // needed to test for certain error
public FHs_treeNode( E d, FHs_treeNode<E> lft, FHs_treeNode<E> rt )
public class FHlazySTNode<E extends Comparable< ? super E > >
{
// use public access so the tree or other classes can access members
public FHlazySTNode<E> lftChild, rtChild;
public E data;
public FHlazySTNode<E> myRoot; // needed to test for certain error
public boolean deleted;
public FHlazySTNode( E d, FHlazySTNode<E> lft, FHlazySTNode<E> rt )
{
@OneRaynyDay
OneRaynyDay / Orb
Last active August 29, 2015 14:09
PAD Solver - Ray Zhang and Young Guo
int[] state = NIL; // <-- enter threshold from constructor
int currentState = 0; <-- state[currentState] = current state
int color;
public Orb(Color c)
color = c;
int[] state = new int[1];
state[0] = NIL;
public Orb(Color c, State s)
color = c;