diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000000000000000000000000000000000..7a9dfa044d022f5ca8cf9191e37fef926dd67f77 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git "a/1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" "b/1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" new file mode 100644 index 0000000000000000000000000000000000000000..fb6da59942290ce22ba5399709b55a5b4e11768d --- /dev/null +++ "b/1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" @@ -0,0 +1,2 @@ +git config --global user.name "苏晓荔" +git config --global user.email "1443874734@qq.com" \ No newline at end of file diff --git "a/2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" "b/2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" new file mode 100644 index 0000000000000000000000000000000000000000..ec6ee61962f2d109f4b5d6a984fa0532274d1213 --- /dev/null +++ "b/2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" @@ -0,0 +1,2 @@ +git branck 38 +git checkout 38 \ No newline at end of file diff --git "a/3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" "b/3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" new file mode 100644 index 0000000000000000000000000000000000000000..0fbd52fa8111ae13721da1f2c119822552292813 --- /dev/null +++ "b/3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" @@ -0,0 +1,3 @@ +git add . +git commit -m "AutoPush" +git push \ No newline at end of file diff --git a/Test/LinkedList.class b/Test/LinkedList.class new file mode 100644 index 0000000000000000000000000000000000000000..3f2ccb48da8e7bb88cfab8e5821d9c060ba468bf Binary files /dev/null and b/Test/LinkedList.class differ diff --git a/Test/LinkedList.java b/Test/LinkedList.java new file mode 100644 index 0000000000000000000000000000000000000000..e0d74f47fac58f2c39797aaa9244b13b9a37d2b9 --- /dev/null +++ b/Test/LinkedList.java @@ -0,0 +1,47 @@ +public class LinkedList { + private Node head; + private Node tail; + + public LinkedList() { + head = null; + tail = null; + } + + public void addToFront(E item) { + Node node = new Node(item); + + if (this.head == null) { + this.head = node; + this.tail = this.head; + } else{ + Node temp = head; + this.head = node; + this.head.next = temp; + } + } + + + public void addToRear(E item) { + Node newNode = new Node(item); + if (this.head == null) { + this.head = newNode; + this.tail = this.head; + } else { + + Node temp = this.tail; + tail = newNode; + temp.next = tail; + + } + } + + public void print() { + Node temp = this.head; + while(temp.next != null){ + System.out.print(temp.item + " -> "); + temp = temp.next; + } + System.out.println(temp.item); + } +} + diff --git a/Test/Main.class b/Test/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..acd5ba79cd19013b43688c117c0f04ebc61dbca7 Binary files /dev/null and b/Test/Main.class differ diff --git a/Test/Main.java b/Test/Main.java new file mode 100644 index 0000000000000000000000000000000000000000..a91ffa11e11038a146b54b7dc41f3be6de49e8b9 --- /dev/null +++ b/Test/Main.java @@ -0,0 +1,10 @@ +class Main { + public static void main(String[] args) { + LinkedList ll = new LinkedList(); + ll.addToFront(1); + ll.addToFront(7); + ll.addToRear(3); + ll.addToRear(8); + ll.print(); + } +} \ No newline at end of file diff --git a/Test/Node.class b/Test/Node.class new file mode 100644 index 0000000000000000000000000000000000000000..a383363383e004072772b0293411ecf05b408603 Binary files /dev/null and b/Test/Node.class differ diff --git a/Test/Node.java b/Test/Node.java new file mode 100644 index 0000000000000000000000000000000000000000..5f1555858f49dd1b3d668202d01aaf8b55124a9a --- /dev/null +++ b/Test/Node.java @@ -0,0 +1,7 @@ +public class Node { + E item; + Node next = null; + Node(E item) { + this.item = item; + } +} \ No newline at end of file diff --git a/Test02/LinkedList.class b/Test02/LinkedList.class new file mode 100644 index 0000000000000000000000000000000000000000..202467e741c2844d4a03aa3bbf3435e2a306ed93 Binary files /dev/null and b/Test02/LinkedList.class differ diff --git a/Test02/LinkedList.java b/Test02/LinkedList.java new file mode 100644 index 0000000000000000000000000000000000000000..170220f0ddd1a0479af6072a7f5feebbeedc99a9 --- /dev/null +++ b/Test02/LinkedList.java @@ -0,0 +1,47 @@ +public class LinkedList { + private Node head; + private Node tail; + + public LinkedList() { + head = null; + tail = null; + } + + public void addToFront(E item) { + Node node = new Node(item); + + if (this.head == null) { + this.head = node; + this.tail = this.head; + } else{ + Node temp = head; + this.head = node; + this.head.next = temp; + temp.pre = this.head; + } + } + + public void addToRear(E item) { + Node newNode = new Node(item); + if (this.head == null) { + this.head = newNode; + this.tail = this.head; + } else { + + Node temp = this.tail; + tail = newNode; + tail.pre = temp; + temp.next = tail; + } + } + + public void print() { + Node temp = this.head; + while(temp.next != null){ + System.out.print(temp.item + " -> "); + temp = temp.next; + } + System.out.println(temp.item); + } +} + diff --git a/Test02/Main.class b/Test02/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..acd5ba79cd19013b43688c117c0f04ebc61dbca7 Binary files /dev/null and b/Test02/Main.class differ diff --git a/Test02/Main.java b/Test02/Main.java new file mode 100644 index 0000000000000000000000000000000000000000..7ff663e0340fe7b10068a186c52a5e57e2099b7f --- /dev/null +++ b/Test02/Main.java @@ -0,0 +1,10 @@ +class Main { + public static void main(String[] args) { + LinkedList ll = new LinkedList(); + ll.addToFront(1); + ll.addToFront(2); + ll.addToRear(3); + ll.addToRear(8); + ll.print(); + } +} \ No newline at end of file diff --git a/Test02/Node.class b/Test02/Node.class new file mode 100644 index 0000000000000000000000000000000000000000..d5d0e569664ec23fdd06c248a33be2f4e3f1a48a Binary files /dev/null and b/Test02/Node.class differ diff --git a/Test02/Node.java b/Test02/Node.java new file mode 100644 index 0000000000000000000000000000000000000000..ef186f85aaa659cb3dacbb507aec4ceaaf55e633 --- /dev/null +++ b/Test02/Node.java @@ -0,0 +1,8 @@ +public class Node { + E item; + Node next = null; + Node pre = null; + Node(E item) { + this.item = item; + } +} \ No newline at end of file