Created
March 9, 2018 20:22
-
-
Save saiema/3b4237e3818937e6457cfe42218139c5 to your computer and use it in GitHub Desktop.
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 List<T> { | |
private Node<T> header; | |
private int size; | |
public void insert(T e){ | |
if (size == 0) header = new Node<T>(e); | |
else { | |
Node current = header; | |
while (current.next != null) { | |
current = current.next | |
} | |
Node<T> newNode = new Node<>(e); | |
current.next = newNode; | |
} | |
size++; | |
} | |
public T get(int i) {} | |
public int size() {} | |
public class Node<T> {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment