Skip to content

Instantly share code, notes, and snippets.

public class BinaryTree
{
// Root of Binary Tree
BinaryNode root;
// Constructors
public BinaryTree(int key)
{
root = new BinaryNode(key);
public class BinaryNode {
int data;
BinaryNode left, right;
BinaryNode(int d) {
data = d;
left = right = null;
}
}
public class BinaryNode {
int data;
BinaryNode left, right;
BinaryNode(int d) {
data = d;
left = right = null;
}
}
import java.util.*;
public class CoinProblem
{
LinkedList helper = new LinkedList();
static int midway = 0;
static BinaryTree tree = new BinaryTree();
import java.net.*;
import java.io.*;
import java.util.StringTokenizer;
import java.util.Scanner;
import java.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
float theta;
void setup() {
size(750, 750);
//strokeWeight(1);
//noStroke();
//fill(0,45);
}
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;
import java.awt.event.MouseEvent;
import java.util.*;
public class freeResponse2
{
public freeResponse2()
{
String[] artists = {"Ariana Grande", "Ariana Grande", "Ariana Grande","Halsey","Halsey","Post Malone","Post Malone","Post Malone","Ariana Grande","Ariana Grande","Ariana Grande","Ariana Grande","Lady Gaga","Lady Gaga","Lady Gaga","Lady Gaga","Jonas Brothers","Jonas Brothers","Jonas Brothers","Jonas Brothers","Jonas Brothers","Jonas Brothers","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Lil Nas X","Billie Eilish","Billie Eilish","Billie Eilish","Billie Eilish","Billie Eilish","Billie Eilish","Shawn Mendes","Lizzo","Lizzo","Lizzo","Lizzo","Lizzo","Lizzo","Travis Scott","Selena Gomez","Selena Gomez","Post Malone","Post Malone","Post Malone","Post Malone","The Weeknd","Mariah Carey","Mariah Carey"};
LinkedList artistsList = new LinkedList();
public class freeResponse1
{
public freeResponse1()
{
LinkedList list = new LinkedList();
list.insert(list,1);
list.insert(list,6);
list.insert(list,2);
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;