단일 체인 테이블, 그리고 역전환 실현,

1444 단어
/**
 * @author By zhouwx5
 * @Created on by 2019/11/19
 * @Desc:
 */
public class  LinkedNode {

    private Node header;
    private Node tail;
    private int size;

    private void linkList(){
        header =null;
        tail =null;
    }

    private void linkList(T element){
        header =new Node(element,null);
        tail =header;
        size++;
    }
    private int length(){
        return size;
    }

    /**
     *  
     * @param index  
     * @return  
     */
    private T get(int index){
        return (T) this.getNodeIndex(index).getDate();
    }

    /**
     *  
     * @param index  
     * @return index 
     */
    private Node getNodeIndex(int index) {
        if (index<0||index>size-1) {
            System.out.println(" ");
            throw new IndexOutOfBoundsException(" ");
        }
        Node currend =header;
        for (int i =0;i

좋은 웹페이지 즐겨찾기