Skip to content

Instantly share code, notes, and snippets.

package cc150_4_3;
import java.util.Arrays;
public class BTMH <Key extends Comparable<Key>> {
private Node root;
private class Node{
private int key;
private Node left, right;
package cc150_4_2;
import java.util.*;
public class CheckRoute {
public static boolean Route(int[][] graph, int head, int endp){
if(graph.length < 2) return false;
package cc150_4_1;
public class BalanceTree<Key extends Comparable<Key>> {
private Node root;
private class Node{
private Key key;
private Node left, right;
public Node(Key key){
import java.util.Date;
public class Animal{
String type;
Date arrived;
}
import java.util.Stack;
public class PeakStack {
Stack<Integer> origin;
Stack<Integer> peak;
int top_o;
int top_p;
package cc150_3_5;
import java.util.Stack;
public class StackQueue<T> {
private Stack<T> origin;
private Stack<T> reverse;
public StackQueue(){
package cc150_3_4;
import java.util.Stack;
public class Hanoi {
public static void main(String[] args){
import java.util.Stack;
import java.util.ArrayList;
public class SubStacks {
private ArrayList<substack> stacks;
private int sub_capacity;
private int cur_stack;
private class substack<T>{
public class Node<Item> {
Item item = null;
Node next = null;
public Node(Item item){
this.item = item;
this.next = null;
}
}
package cc150_3_1;
public class ArrayStack {
private int[] data;
private int[] sk_lp = new int[3];
private int[] sk_hp = new int[3];
private int[] top_p = new int[3];
public ArrayStack(int capacity) throws Exception{