Java数据结构之循环链表(与单链表比较)

public class LoopNode {
int data;
LoopNode next = this;//与单链表的不同

public LoopNode(int data)
{
this.data = data;
}

//插入节点
public void insertNext(LoopNode node)
{
node.next = this.next;
this.next = node;
}

}

猜你喜欢

转载自www.cnblogs.com/baoyingying/p/11794492.html