This file contains 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
/* | |
* Created by bitcpf | |
*/ | |
package cc150_1_8; | |
public class StringRotation { | |
public static boolean isSubstring(String s1, String s2){ |
This file contains 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
public class Node<Item> { | |
Item item = null; | |
Node<Item> next = null; | |
public Node (Item item){ | |
this.item = item; | |
this.next = null; | |
} | |
public int getval(){ |
This file contains 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
public class Node<Item> { | |
Item item = null; | |
Node next = null; | |
public Node(Item input){ | |
this.item = input; | |
this.next = null; | |
} |
This file contains 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
/* | |
Created by bitcpf | |
*/ | |
package cc150_2_6; | |
import java.util.LinkedList; | |
public class CircleDetect { | |
This file contains 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
public class Node<Item> { | |
Item item = null; | |
Node next = null; | |
public Node(Item item){ | |
this.item = item; | |
this.next = null; | |
} | |
} |
This file contains 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
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{ |
This file contains 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
public class Node<Item> { | |
Item item = null; | |
Node next = null; | |
public Node(Item item){ | |
this.item = item; | |
this.next = null; | |
} | |
} |
This file contains 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.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>{ |
This file contains 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
package cc150_3_4; | |
import java.util.Stack; | |
public class Hanoi { | |
public static void main(String[] args){ | |
This file contains 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
package cc150_3_5; | |
import java.util.Stack; | |
public class StackQueue<T> { | |
private Stack<T> origin; | |
private Stack<T> reverse; | |
public StackQueue(){ |