자료구조와 알고리즘 A+ 기원.
: 이름, 멤버 등이 모인 형태 = set
: 삽입&삭제가 많을 때 유용하며 배열 구조가 아닌 연결 구조
public class Linked_List<T> implements List<T>{
class Node<T> {
private T data; // 현재 노드의 값
private Node<T> next; // 다음 노트를 가리킴
Node(T dataPortion) { // 다음 노드가 없을 때
this(dataPortion, null);
}
Node(T dataPortion, Node<T> nextNode){
data = dataPortioin;
next = nextNode;
}
T getData(){
return data;
}
Node<T> getNextNode(){
return next;
}
void setData(T newData){
data = newData;
}
void setNextNode(Node<T> nextNode{
next = nextNode;
}
}
private Node<T> list; //첫 번째 노트 선언
private int numberOfEntries;
public Linked_List(){}
public boolean add(T newEntry){}
public boolean add(int givenPosition, T newEntry){} // 내가 넣고 싶은 위치에 넣음
public boolean remove(T anEntry){}
public T remove(int givenPosition){}
public T get(int givenPositioin){}
public int indexOf(T anEntry){}
public void clear(){}
public int size(){}
public String toString(){}
: next만 존재
: prev, next 모두 존재