This file contains hidden or 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 DavisLinkedList<T> { | |
| private Node first = null; | |
| //adds to the front | |
| public void addF(Node n) { | |
| n.setNext(first); | |
| first = n; | |
| } |
This file contains hidden or 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<T> { | |
| private T data; | |
| private Node next; | |
| public Node(T value) { | |
| data = value; | |
| } | |
This file contains hidden or 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 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")); | |
This file contains hidden or 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 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"); |
This file contains hidden or 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
| //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]; |
This file contains hidden or 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.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 |
This file contains hidden or 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.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(); |
This file contains hidden or 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.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. |
This file contains hidden or 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.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 |
This file contains hidden or 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.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" |
NewerOlder