복습 의 데이터 구조 - 링크
                                            
 1351 단어  대열
                    
package link;
/**
 *    
 * @author Administrator
 *
 */
public class Node {
	long data;
	Node next;
	
	public Node(long value){
		this.data = value;
	}
	
	/**
	 *   
	 */
	public void display(){
		System.out.print(data+" ");
	}
}링크 클래스
package link;
public class LinkList {
	private Node first;
	
	/**
	 *       
	 */
	public void insertNode(long value){
		Node node = new Node(value);
		node.next = first;
		first = node;
	}
	
	/**
	 *     
	 */
	public void display(){
		Node current = first;
		while(current != null){
			current.display();
			current = current.next;
		}
		System.out.println();
	}
	
	/**
	 *       
	 */
	public void deleteFirst(){
		Node tmp = first;
		first = tmp.next;
	}
	
	/**
	 *     
	 */
	public Node find(long value){
		Node current = first;
		while(current.data != value){
			if(current.next == null){
				return null;
			}
			current = current.next;
		}
		return current;
	}
	
	/**
	 *        
	 */
	public void delete(long value){
		Node current = first;
		Node tmp = first;
		while(current.data != value){
			if(current.next == null){
				return;
			}
			tmp = current;
			current = current.next;
		}
		if(current == first){
			first = current.next;
		}else{
			tmp.next = current.next;
		}
	}
}코드 를 먼저 붙 이 고 내일 시간 이 있 으 면 설명 을 더 해라.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단한 애니메이션 대기열 모델텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.