Skip to content

Instantly share code, notes, and snippets.

import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseListener;
/************Graph.java***************/
import java.util.*;
public class wGraph {
int size;
ArrayList<Edge>[] graph;
public wGraph(int vertices){
/********************************wGraph.java********************************/
import java.util.*;
public class wGraph {
int size;
ArrayList<Edge>[] graph;
public wGraph(int vertices){
/**********Graph.java**********/
import java.util.*;
public class Graph {
int size;
ArrayList<Integer>[] graph;
public Graph(int vertices){
public class SampleRunner
{
public SampleRunner()
{
ArrayList test = new ArrayList();
test.add(1);test.add(2);test.add(3);test.add(4);test.add(5);
test.add(0,10);
public class ArrayList {
int[] arrList;
int size;
public ArrayList () {
size = 0;
arrList = new int[0];
}
public class BinaryNode {
String character;
int data;
BinaryNode left, right;
BinaryNode(int d) {
data = d;
left = right = null;
}
public class BinaryTree
{
// Root of Binary Tree
BinaryNode root;
// Constructors
public BinaryTree(int key)
{
root = new BinaryNode(key);
import java.util.*;
public class Huffman {
static String charCode;
public static void main(String[] args) {
String text = "ABA11$A";
System.out.println("string: " + text);
import java.util.*;
public class Activities
{
public Activities()
{
int[] start = {1,3,0,5,8,5};