下面是我自己写的,编译肯定是过不了的。我不明白的是,是否要接入接口LList,数组要怎么
实现,怎样打印在屏幕上,怎样写,需要怎么改,这类的编程在MyEclipse上要怎么写,是否
要分开写。谢谢你们了,拜托了
class Node{
public T data;
public Node next;
public Node(T data,Node next){
this.data=data;
this.next=next;
}
public Node(){
this(null,null);
}
}
class SinglyLinkedList{
protected Node head;
public SinglyLinkedList(){
this.head=new Node();
}
public SinglyLinkedList(T[] element){
this();
for(int i=0;i
head.next=new Node(element[i],head.next);
}
}
}
public class Ex2_1{
public static void main(String args[]){
SinglyLinkedList s=new SinglyLinkedList();
T[] element={ 6,2,11,5,2,4,2};
System.out.print();
}
}