Skip to content

Instantly share code, notes, and snippets.

public class DavisLinkedList<T> {
private Node first = null;
//adds to the front
public void addF(Node n) {
n.setNext(first);
first = n;
}
public class Node<T> {
private T data;
private Node next;
public Node(T value) {
data = value;
}
public class LinkedListDriver {
public static void main(String[] args) {
DavisLinkedList<String> names = new DavisLinkedList<String>();
names.addF(new Node<String> ("Jeff"));
names.addF(new Node<String> ("Brita"));
names.addF(new Node<String> ("Troy"));
names.addF(new Node<String> ("Annie"));
public class DavisListDriver {
public static void main(String[] args) {
DavisList dl = new DavisList<String>();
dl.add("first");
dl.add("hello");
dl.add("string");
System.out.println(dl.toString());
dl.set(2, "string2");
//genereics (E)
public class DavisList<E> {
private Object[] arr;
private static final int DEFAULT_SIZE = 10;
private int index = 0;
public DavisList() {
arr = new Object[DEFAULT_SIZE];
import java.util.Scanner;
public class LostInTime {
static Scanner s = new Scanner(System.in);
// Write a program that finds the Newmerals that are embedded in Max's message and calculates
// the year that he is stuck in.
//
// sample data to copy into input stream
import java.util.Scanner;
public class CipherDecryption {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String code = sc.nextLine();
String word = sc.nextLine();
import java.util.ArrayList;
import java.util.Scanner;
public class Fibonotcci {
static Scanner s = new Scanner(System.in);
// A Fibonotcci sequence consists of a series of numbers, initially of length n. Each successive term is
// calculated by alternatively adding and subtracting the previous n elements, where n is the length of the
// original series.
import java.util.Scanner;
public class FutureMrSwope {
// Fax numbers are ten digits long. Future Mr. Swope has agreed to always fax from a number
// whose last five digits are each divisible by the same number, excluding 1. The sum of all
// ten digits also must be divisible by this same number. Lastly the final five digits must be
// in non-decreasing order.
//
// sample data to copy into input stream
import java.util.Scanner;
public class newWAveCAse {
static Scanner s = new Scanner(System.in);
// Given a string in various variable naming conventions, output that string in newWAveCAse.
// newWAveCAse is the practice of writing identifiers such that each word or abbreviation phrase,
// other than the first word, begins with two capital letters, with no intervening spaces or
// punctuation. The first word starts with a lowercase letter. For example, "Noah Rubin Salary"