Welcome

首页 / 软件开发 / 数据结构与算法 / 合并有序链表

合并有序链表2010-11-19zhangjunhd场景:存在表L1(A B C D E),有序表L2(2 4 8),有序表L3(2 5).删除表L1中位 置序号属于有序表L2和L3,即删除后L1(A C).

使用的是一个链表节点

public class Inode {
private int value;
private Inode next;
public Inode(int value) {
this.value = value;
next = null;
}
public Inode(int value, Inode next) {
this.value = value;
this.next = next;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public Inode getNext() {
return next;
}
public void setNext(Inode next) {
this.next = next;
}
}