1+ package cn .byhieg .algorithmtutorialtest ;
2+
3+ import cn .byhieg .algorithmtutorial .SingleLinkList ;
4+ import junit .framework .TestCase ;
5+
6+ /**
7+ * Created by byhieg on 17/5/2.
8+ * Mail to byhieg@gmail.com
9+ */
10+ public class SingleLinkListTest extends TestCase {
11+
12+
13+ SingleLinkList linkList ;
14+
15+ public void setUp () throws Exception {
16+ super .setUp ();
17+ linkList = new SingleLinkList ();
18+ }
19+
20+ public void tearDown () throws Exception {
21+ // linkList.printLinkList(linkList.head);
22+ // System.out.println();
23+ }
24+
25+
26+ public void testInsertFromTail () throws Exception {
27+ // linkList.insertFromTail(1);
28+ // linkList.insertFromTail(2);
29+ // linkList.insertFromTail(3);
30+ // linkList.insertFromTail(4);
31+ // linkList.insertFromTail(5);
32+ // linkList.insertFromTail(6);
33+ // System.out.println("尾插入");
34+ }
35+
36+ public void testInsertFromHead () throws Exception {
37+ // linkList.insertFromHead(1);
38+ // linkList.insertFromHead(2);
39+ // linkList.insertFromHead(3);
40+ // linkList.insertFromHead(4);
41+ // linkList.insertFromHead(5);
42+ // linkList.insertFromHead(6);
43+ // System.out.println("头插入");
44+ }
45+ public void testReverseLinkList () throws Exception {
46+ linkList .insertFromHead (1 );
47+ linkList .insertFromHead (2 );
48+ linkList .insertFromHead (3 );
49+ linkList .insertFromHead (4 );
50+ linkList .insertFromHead (5 );
51+ linkList .insertFromHead (6 );
52+ linkList .printLinkList (linkList .reverseLinkList ());
53+ }
54+ public void testGetHead () throws Exception {
55+ }
56+
57+ }
0 commit comments