-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestClass.java
More file actions
39 lines (31 loc) · 939 Bytes
/
Copy pathTestClass.java
File metadata and controls
39 lines (31 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package class1;
import java.io.FileNotFoundException;
import org.omg.PortableInterceptor.INACTIVE;
import class1.DoubleDirectionLinkedList.doubleNode;
import class1.LinkedList.Node;
/**
* 堆栈的测试类
* @author liyafei
*
*/
public class TestClass {
public static void main(String[] args) throws FileNotFoundException {
//单链表测试
// LinkedList<Integer> ll=new LinkedList<Integer>();
// ll.insert(6);
// ll.insert(6);
// Node first=ll.first;
// ll.print(first);
DoubleDirectionLinkedList<Integer> ddll=new DoubleDirectionLinkedList<>();
ddll.insert(54);
ddll.insert(5);
ddll.insert(40);
ddll.insert(45);
ddll.insert(98);
doubleNode node=ddll.head; //逆向打印
ddll.print(node);
System.out.println("删除后");
ddll.delete(node, 40);
ddll.print(node);
}
}