diff --git a/.gitignore b/.gitignore
index 77cdfba900..a152f4f2f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,13 @@ target
liuxin/.DS_Store
liuxin/src/.DS_Store
+
+group18/564673292/src/com/coderising/download/.project
+
+group18/564673292/src/com/coderising/download/.classpath
+
+group18/564673292/out/production/coding2017/com/coderising/download/.project
+
+*.jpg
+
+group18/564673292/out/production/coding2017/com/coderising/download/.classpath
diff --git a/group18/1049843090/.classpath b/group18/1049843090/.classpath
deleted file mode 100644
index 68a547a96e..0000000000
--- a/group18/1049843090/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/group18/1049843090/.gitignore b/group18/1049843090/.gitignore
deleted file mode 100644
index 117a0b15d5..0000000000
--- a/group18/1049843090/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.idea
-*.iml
-*.eml
-.settings/
-target/
-build/
-out/
\ No newline at end of file
diff --git a/group18/1049843090/.project b/group18/1049843090/.project
deleted file mode 100644
index 978233664c..0000000000
--- a/group18/1049843090/.project
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 1049843090
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/group18/1049843090/src/com/coderising/array/ArrayUtil.java b/group18/1049843090/src/com/coderising/array/ArrayUtil.java
deleted file mode 100644
index 23e5bd2215..0000000000
--- a/group18/1049843090/src/com/coderising/array/ArrayUtil.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package com.coderising.array;
-
-
-import com.coding.basic.Queue;
-import com.coding.basic.Stack;
-
-public class ArrayUtil {
-
- /**
- * 给定一个整形数组a , 对该数组的值进行置换
- * 例如: a = [7, 9 , 30, 3] , 置换后为 [3, 30, 9,7]
- * 如果 a = [7, 9, 30, 3, 4] , 置换后为 [4,3, 30 , 9,7]
- *
- * @param origin
- * @return
- */
- public void reverseArray(int[] origin) {
- if (isEmptyOrNull(origin)) {
- return;
- }
- //solution 1 move element
- //for (int i = 0; i <= origin.length >> 2; i++) {
- // int temp = origin[i];
- // origin[i] = origin[origin.length - 1 - i];
- // origin[origin.length - 1 - i] = temp;
- //}
-
- //solution 2 use Stack
- Stack stack = new Stack<>();
- for (int i : origin) {
- stack.push(i);
- }
- for (int i = 0; i < origin.length; i++) {
- origin[i]=stack.pop();
- }
- }
-
- /**
- * 现在有如下的一个数组: int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5}
- * 要求将以上数组中值为0的项去掉,将不为0的值存入一个新的数组,生成的新数组为:
- * {1,3,4,5,6,6,5,4,7,6,7,5}
- *
- * @param oldArray
- * @return
- */
-
- public int[] removeZero(int[] oldArray) {
- if (isEmptyOrNull(oldArray)) {
- return null;
- }
- //solution 1 use Queue OR Stack
- //Queue queue = new Queue<>();
- //for (int i : oldArray) {
- // if (i != 0) {
- // queue.enQueue(i);
- // }
- //}
- //int[] newArray = new int[queue.size()];
- //for (int i = 0; i < newArray.length; i++) {
- // newArray[i] = queue.deQueue();
- //}
- //return newArray;
-
-
- //solution 2 use Array
- int[] tempArray = new int[oldArray.length];
- int index = 0;
- for (int i = 0; i < oldArray.length; i++) {
- if (oldArray[i] != 0) {
- tempArray[index++] = oldArray[i];
- }
- }
- int[] newArray = new int[index];
- System.arraycopy(tempArray,0,newArray,0,index);
- return newArray;
- }
-
- /**
- * 给定两个已经排序好的整形数组, a1和a2 , 创建一个新的数组a3, 使得a3 包含a1和a2 的所有元素, 并且仍然是有序的
- * 例如 a1 = [3, 5, 7,8] a2 = [4, 5, 6,7] 则 a3 为[3,4,5,6,7,8] , 注意: 已经消除了重复
- *
- * @param array1
- * @param array2
- * @return
- */
-
- public int[] merge(int[] array1, int[] array2) {
-
- return null;
- }
-
- /**
- * 把一个已经存满数据的数组 oldArray的容量进行扩展, 扩展后的新数据大小为oldArray.length + size
- * 注意,老数组的元素在新数组中需要保持
- * 例如 oldArray = [2,3,6] , size = 3,则返回的新数组为
- * [2,3,6,0,0,0]
- *
- * @param oldArray
- * @param size
- * @return
- */
- public int[] grow(int[] oldArray, int size) {
- if (isEmptyOrNull(oldArray)) {
- return null;
- }
- int[] newArray = new int[oldArray.length + size];
- //solution 1 use System.arraycopy
- //System.arraycopy(oldArray,0,newArray,0, oldArray.length);
-
- //solution 2 use loop
- for (int i = 0; i < oldArray.length; i++) {
- newArray[i] = oldArray[i];
- }
- return newArray;
- }
-
- /**
- * 斐波那契数列为:1,1,2,3,5,8,13,21...... ,给定一个最大值, 返回小于该值的数列
- * 例如, max = 15 , 则返回的数组应该为 [1,1,2,3,5,8,13]
- * max = 1, 则返回空数组 []
- *
- * @param max
- * @return
- */
- public int[] fibonacci(int max) {
- return null;
- }
-
- /**
- * 返回小于给定最大值max的所有素数数组
- * 例如max = 23, 返回的数组为[2,3,5,7,11,13,17,19]
- *
- * @param max
- * @return
- */
- public int[] getPrimes(int max) {
- return null;
- }
-
- /**
- * 所谓“完数”, 是指这个数恰好等于它的因子之和,例如6=1+2+3
- * 给定一个最大值max, 返回一个数组, 数组中是小于max 的所有完数
- *
- * @param max
- * @return
- */
- public int[] getPerfectNumbers(int max) {
- return null;
- }
-
- /**
- * 用seperator 把数组 array给连接起来
- * 例如array= [3,8,9], seperator = "-"
- * 则返回值为"3-8-9"
- *
- * @param array
- * @param seperator 分隔符
- * @return
- */
- public String join(int[] array, String seperator) {
- if (isEmptyOrNull(array)) {
- return "";
- }
- if (array.length < 2) {
- return array[0] + "";
- }
- StringBuffer stringBuffer = new StringBuffer();
- for (int i = 0; i < array.length - 1; i++) {
- stringBuffer.append(array[i] + seperator);
- }
- stringBuffer.append(array[array.length - 1]);
- return stringBuffer.toString();
- }
-
- /**
- * 检查数组是否为空或者为null
- *
- * @param array
- * @return
- */
- private boolean isEmptyOrNull(int[] array) {
- if (array == null || array.length == 0) {
- return true;
- }
- return false;
- }
-
- public static void main(String[] args) {
- int[] a = {7,9,5};
- ArrayUtil arrayUtil = new ArrayUtil();
- arrayUtil.reverseArray(a);
- for (int i : a) {
- System.out.println(i);
- }
- }
-
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/ArrayList.java b/group18/1049843090/src/com/coding/basic/ArrayList.java
deleted file mode 100644
index f6b3007a7d..0000000000
--- a/group18/1049843090/src/com/coding/basic/ArrayList.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package com.coding.basic;
-
-import java.util.Arrays;
-
-/**
- * A Simple ArrayList
- */
-public class ArrayList implements List {
-
- /**
- * 当前list的元素个数
- */
- private int size;
-
- /**
- * 默认数组大小
- */
- private static final int DEFAULT_CAPACITY = 10;
-
- /**
- * 存储元素的数组
- */
- private Object[] elementData;
-
- /**
- * 追加一个元素
- *
- * @param e
- */
- public void add(E e) {
- grow();
- elementData[size++] = e;
- }
-
- private void grow() {
- if (elementData.length == size) {
- elementData = Arrays.copyOf(elementData, size + 10);
- }
- }
-
- /**
- * 插入一个元素到指定位置
- *
- * @param index
- * @param e
- */
- public void add(int index, E e) {
- if (index < 0 || index > size) {
- throw new IndexOutOfBoundsException("下标越界");
- }
- grow();
- int movedNum = size - index;
- if (movedNum > 0) {
- System.arraycopy(elementData, index, elementData, index + 1, movedNum);
- }
- elementData[index] = e;
- size++;
- }
-
- /**
- * 获取指定位置的元素
- *
- * @param index
- * @return
- */
- public E get(int index) {
- checkIndex(index);
- return getElement(index);
- }
-
-
- /**
- * 删除指定位置的元素
- *
- * @param index
- * @return
- */
- public E remove(int index) {
- checkIndex(index);
- E delEle = getElement(index);
- int movedNum = size - index - 1;//是不是最后一个元素
- if (movedNum > 0) {
- System.arraycopy(elementData, index + 1, elementData, index, movedNum);
- }
- elementData[--size] = null;
- return delEle;
- }
-
- private void checkIndex(int index) {
- if (index < 0 || index >= size) {
- throw new IndexOutOfBoundsException("下标越界");
- }
- }
-
- private E getElement(int index) {
- return (E) elementData[index];
- }
-
- /**
- * list中元素的个数
- *
- * @return
- */
- public int size() {
- return this.size;
- }
-
-
- public ArrayList() {
- this.elementData = new Object[DEFAULT_CAPACITY];
- }
-
- public Iterator iterator() {
- return new ArrayListIterator();
- }
-
- private class ArrayListIterator implements Iterator {
-
- private int cursor;//游标
-
- private int lastRet = -1;//可被删除元素下标
-
-
- @Override
- public boolean hasNext() {
- return cursor != size;
- }
-
- @Override
- public E next() {
- int i = cursor;
- cursor++;
- return (E) elementData[lastRet = i];
- }
-
- @Override
- public void remove() {
- if (lastRet < 0) {
- throw new IllegalStateException();
- }
- cursor = lastRet;//游标等于当前删除元素的下标 或者 cursor--;
- ArrayList.this.remove(lastRet);
- lastRet = -1;//重置可删元素下标
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/BinaryTree.java b/group18/1049843090/src/com/coding/basic/BinaryTree.java
deleted file mode 100644
index 7f476b1d74..0000000000
--- a/group18/1049843090/src/com/coding/basic/BinaryTree.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.coding.basic;
-
-
-/**
- *
- */
-public class BinaryTree {
-
- private Node root;
-
- public boolean insert(int data) {
- Node newNode = new Node(data);
- if (root == null) {
- root = newNode;
- return true;
- }
-
- return add(data);
- //return add(root,new Node(data));
- }
-
- private boolean add(Node currentNode,Node newNode) {
- if (currentNode.data == newNode.data) {
- return false;
- }
- if (currentNode.data < newNode.data) {
- if (currentNode.right == null) {
- currentNode.right = newNode;
- return true;
- } else {
- return add(currentNode.right, newNode);
- }
- }
- if (currentNode.left == null) {
- currentNode.left = newNode;
- return true;
- } else {
- return add(currentNode.left, newNode);
- }
- }
-
- private boolean add(int data) {
- Node newNode = new Node(data);
- boolean result = false;
- Node cursorNode = root;
- Node parentNode = null;
- while (true) {
- parentNode = cursorNode;
- if (cursorNode.data == data) {
- break;
- }
- if (cursorNode.data < data) {
- cursorNode = cursorNode.right;
- if (cursorNode == null) {
- parentNode.right = newNode;
- result = true;
- break;
- }
- } else {
- cursorNode = cursorNode.left;
- if (cursorNode == null) {
- parentNode.left = newNode;
- result = true;
- break;
- }
- }
- }
- return result;
- }
-
-
- private static class Node {
- int data;
- Node left, right;
-
- public Node(int data) {
- this.data = data;
- this.left = null;
- this.right = null;
- }
- }
-
- public static void main(String[] args) {
- BinaryTree binaryTree = new BinaryTree();
- binaryTree.insert(5);
- binaryTree.insert(6);
- binaryTree.insert(4);
- binaryTree.insert(8);
- binaryTree.insert(7);
- binaryTree.insert(3);
-
- System.out.println("finsh");
- }
-
-}
diff --git a/group18/1049843090/src/com/coding/basic/BinaryTreeNode.java b/group18/1049843090/src/com/coding/basic/BinaryTreeNode.java
deleted file mode 100644
index 20f90e9239..0000000000
--- a/group18/1049843090/src/com/coding/basic/BinaryTreeNode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.coding.basic;
-
-/**
- * Binary Tree
- */
-public class BinaryTreeNode {
-
- /**
- * 节点数据
- */
- private Object data;
- /**
- * 左节点
- */
- private BinaryTreeNode left;
- /**
- * 右节点
- */
- private BinaryTreeNode right;
-
- public Object getData() {
- return data;
- }
-
- public void setData(Object data) {
- this.data = data;
- }
-
- public BinaryTreeNode getLeft() {
- return left;
- }
-
- public void setLeft(BinaryTreeNode left) {
- this.left = left;
- }
-
- public BinaryTreeNode getRight() {
- return right;
- }
-
- public void setRight(BinaryTreeNode right) {
- this.right = right;
- }
-
- public BinaryTreeNode insert(Object o) {
- return null;
- }
-
- public BinaryTreeNode(Object o){
- this.setData(o);
- }
-
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/Iterator.java b/group18/1049843090/src/com/coding/basic/Iterator.java
deleted file mode 100644
index f4938a46c7..0000000000
--- a/group18/1049843090/src/com/coding/basic/Iterator.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.coding.basic;
-
-/**
- * Iterator
- */
-public interface Iterator {
-
- /**
- * 可迭代对象是否还有值
- *
- * @return
- */
- boolean hasNext();
-
- /**
- * 返回迭代对象的下一个元素
- *
- * @return
- */
- E next();
-
- /**
- * 移除当前元素
- */
- void remove();
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/LinkedList.java b/group18/1049843090/src/com/coding/basic/LinkedList.java
deleted file mode 100644
index 7b4a378301..0000000000
--- a/group18/1049843090/src/com/coding/basic/LinkedList.java
+++ /dev/null
@@ -1,238 +0,0 @@
-package com.coding.basic;
-
-import java.util.NoSuchElementException;
-
-/**
- * A Simple LinkedList
- *
- * @param element
- */
-public class LinkedList implements List {
- /**
- * 链表head
- */
- private Node head;
-
-
- /**
- * 链表中元素的个数
- */
- private int size;
-
-
- /**
- * 追加一个元素到链表尾
- *
- * @param e
- */
- public void add(E e) {
- Node newNode = new Node(e, null);
- if (this.head == null) {
- this.head = newNode;
- } else {
- Node end = index(size - 1);
- end.next = newNode;
- }
- size++;
- }
-
- /**
- * 插入一个元素到链表指定位置
- *
- * @param index
- * @param e
- */
- public void add(int index, E e) {
- if (index < 0 || index > size) {
- throw new IndexOutOfBoundsException("下标越界");
- }
- if (index == 0) {
- addFirst(e);
- } else if (index == size) {
- addLast(e);
- } else {
- Node indexNode = index(index);
- Node next = indexNode.next;
- Node newNode = new Node(e, next);
- index(index - 1).next = newNode;
- indexNode = null;
- size++;
- }
- }
-
- /**
- * 获取指定位置的元素
- *
- * @param index
- * @return
- */
- public E get(int index) {
- checkIndex(index);
- return index(index).data;
- }
-
- private void checkIndex(int index) {
- if (index < 0 || index >= size) {
- throw new IndexOutOfBoundsException("下标越界");
- }
- }
-
- /**
- * 移除指定位置的元素
- *
- * @param index
- * @return
- */
- public E remove(int index) {
- checkIndex(index);
- if (index == 0) {
- return removeFirst();
- } else if (index == (size - 1)) {
- return removeLast();
- } else {
- Node delNode = index(index);
- E e = delNode.data;
- Node prev = index(index - 1);
- prev.next = index(index + 1);
- delNode = null;
- size--;
- return e;
- }
- }
-
- /**
- * 当前链表的元素个数
- *
- * @return
- */
- public int size() {
- return this.size;
- }
-
- /**
- * 添加到链表的头
- *
- * @param e
- */
- public void addFirst(E e) {
- Node newNode = new Node(e, null);
- if (this.head != null) {
- newNode.next = this.head;
- }
- this.head = newNode;
- size++;
- }
-
- /**
- * 添加到链表的尾
- *
- * @param e
- */
- public void addLast(E e) {
- Node newNode = new Node(e, null);
- if (this.head == null) {
- this.head = newNode;
- } else {
- Node end = index(size - 1);
- end.next = newNode;
- }
- size++;
- }
-
- /**
- * 获取指定位置的节点
- *
- * @param index
- * @return
- */
- private Node index(int index) {
- Node node = this.head;
- for (int i = 0; i < index; i++) {
- node = node.next;
- }
- return node;
- }
-
- /**
- * 删除链表第一个元素
- *
- * @return
- */
- public E removeFirst() {
- if (head == null) {
- throw new NoSuchElementException();
- }
- E e = head.data;
- head = head.next;
- size--;
- return e;
- }
-
- /**
- * 删除链表最后一个元素
- *
- * @return
- */
- public E removeLast() {
- if (head == null) {
- throw new NoSuchElementException();
- }
- Node end = index(size - 1);
- E e = end.data;
- end = null;
- end = index(size - 2);
- end.next = null;
- size--;
- return e;
- }
-
- /**
- * 节点数据
- *
- * @param
- */
- private static class Node {
- //当前节点存储的数据
- E data;
- //下一个节点
- Node next;
-
- public Node(E data, Node next) {
- this.data = data;
- this.next = next;
- }
- }
-
- public Iterator iterator(){
- return new LinkedListIterator<>();
- }
-
- private class LinkedListIterator implements Iterator{
-
- private int cursor;//游标
-
- private int lastRet = -1;//可被删除元素下标
-
- @Override
- public boolean hasNext() {
- return cursor!=size;
- }
-
- @Override
- public E next() {
- int i = cursor;
- cursor++;
- return (E) LinkedList.this.get(lastRet=i);
- }
-
- @Override
- public void remove() {
- if(lastRet<0){
- throw new IllegalStateException();
- }
- cursor = lastRet;
- LinkedList.this.remove(lastRet);
- lastRet = -1;
- }
- }
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/List.java b/group18/1049843090/src/com/coding/basic/List.java
deleted file mode 100644
index 962fcf4b77..0000000000
--- a/group18/1049843090/src/com/coding/basic/List.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.coding.basic;
-
-/**
- * A Simple List Interface
- */
-public interface List {
-
- /**
- * 追加一个元素
- *
- * @param e
- */
- void add(E e);
-
- /**
- * 插入一个元素到指定位置
- *
- * @param index
- * @param e
- */
- void add(int index, E e);
-
- /**
- * 获取指定位置元素
- *
- * @param index
- * @return
- */
- E get(int index);
-
- /**
- * 移除指定位置元素
- *
- * @param index
- * @return
- */
- E remove(int index);
-
-
- /**
- * 当前List中元素的个数
- *
- * @return
- */
- int size();
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/Queue.java b/group18/1049843090/src/com/coding/basic/Queue.java
deleted file mode 100644
index 94759f0b5b..0000000000
--- a/group18/1049843090/src/com/coding/basic/Queue.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.coding.basic;
-
-/**
- * A Simple Queue
- */
-public class Queue {
-
- private LinkedList elementData;
-
- /**
- * 入列
- *
- * @param e
- */
- public void enQueue(E e) {
- elementData.addLast(e);
- }
-
- /**
- * 出列
- *
- * @return
- */
- public E deQueue() {
- return elementData.removeFirst();
- }
-
- /**
- * 查看第一个元素
- *
- * @return
- */
- public E peek() {
- return elementData.size()==0?null:elementData.get(0);
- }
-
- /**
- * 队列是否有元素
- *
- * @return
- */
- public boolean isEmpty() {
- return elementData.size() == 0;
- }
-
- /**
- * 队列中元素个数
- *
- * @return
- */
- public int size() {
- return elementData.size();
- }
-
- public Queue() {
- elementData = new LinkedList();
- }
-}
\ No newline at end of file
diff --git a/group18/1049843090/src/com/coding/basic/Stack.java b/group18/1049843090/src/com/coding/basic/Stack.java
deleted file mode 100644
index 61561f1450..0000000000
--- a/group18/1049843090/src/com/coding/basic/Stack.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.coding.basic;
-
-import java.util.EmptyStackException;
-
-/**
- * A Simple Stack
- */
-public class Stack {
- private ArrayList elementData;
-
- /**
- * 压入栈顶
- *
- * @param e
- */
- public void push(E e) {
- elementData.add(e);
- }
-
- /**
- * 取出栈顶元素
- *
- * @return
- */
- public E pop() {
- return elementData.remove(elementData.size() - 1);
- }
-
- /**
- * 查看栈顶元素
- *
- * @return
- */
- public E peek() {
- if(isEmpty()){
- throw new EmptyStackException();
- }
- return elementData.get(elementData.size() - 1);
- }
-
- /**
- * 栈内是否有元素
- *
- * @return
- */
- public boolean isEmpty() {
- return elementData.size() == 0;
- }
-
- /**
- * 栈顶内元素个数
- *
- * @return
- */
- public int size() {
- return elementData.size();
- }
-
- public Stack() {
- elementData = new ArrayList();
- }
-}
\ No newline at end of file
diff --git a/group18/1049843090/test/com/coding/basic/ArrayListTest.java b/group18/1049843090/test/com/coding/basic/ArrayListTest.java
deleted file mode 100644
index 25b2a018df..0000000000
--- a/group18/1049843090/test/com/coding/basic/ArrayListTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.coding.basic;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * ArrayList Test
- */
-public class ArrayListTest {
-
- ArrayList list;
-
- @Before
- public void setUp() throws Exception {
- list = new ArrayList<>();
-
- }
-
- @After
- public void tearDown() throws Exception {
- list = null;
- }
-
- @Test
- public void add() throws Exception {
- list.add("first");
- assertEquals("first", list.get(0));
- }
-
- @Test
- public void add1() throws Exception {
- list.add(0, "first");
- assertEquals("插入第一条", "first", list.get(0));
- list.add(0, "insert");
- assertEquals("插入第二条", "insert", list.get(0));
- list.add(2, "position_2");
- assertEquals("position_2", list.get(2));
- assertEquals(3, list.size());
- }
-
- @Test
- public void get() throws Exception {
- list.add("first");
- list.add("second");
- list.add("third");
- assertEquals("first", list.get(0));
- assertEquals("second", list.get(1));
- assertEquals("third", list.get(2));
-
- }
-
- @Test
- public void remove() throws Exception {
- list.add("first");
- list.add("second");
- list.add("third");
- list.add("fourth");
- assertEquals("first", list.remove(0));
- assertEquals(3, list.size());
- assertEquals("third", list.remove(1));
- assertEquals("fourth", list.remove(1));
- assertEquals(1, list.size());
-
- }
-
- @Test
- public void size() throws Exception {
- list.add("first");
- assertEquals(1,list.size());
- list.add("second");
- assertEquals( 2,list.size());
- }
-
-
- @Test
- public void iterator() throws Exception {
- Iterator iterator = list.iterator();
- assertEquals(false,iterator.hasNext());
- list.add("A");
- assertEquals(true,iterator.hasNext());
- assertEquals("A",iterator.next());
- iterator.remove();
- assertEquals(0,list.size());
- }
-
-}
\ No newline at end of file
diff --git a/group18/1049843090/test/com/coding/basic/LinkedListTest.java b/group18/1049843090/test/com/coding/basic/LinkedListTest.java
deleted file mode 100644
index fb962287d3..0000000000
--- a/group18/1049843090/test/com/coding/basic/LinkedListTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.coding.basic;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * LinkedList Test
- */
-public class LinkedListTest {
-
- LinkedList linkedList;
-
- @Before
- public void setUp() throws Exception {
- linkedList = new LinkedList<>();
- }
-
- @After
- public void tearDown() throws Exception {
- linkedList = null;
- }
-
- @Test
- public void add() throws Exception {
- linkedList.add("first");
- linkedList.add("second");
- assertEquals(2, linkedList.size());
-
- }
-
- @Test
- public void add1() throws Exception {
- linkedList.add(0, "first");
- linkedList.add(1, "second");
- assertEquals("first", linkedList.get(0));
- assertEquals("second", linkedList.get(1));
- assertEquals(2, linkedList.size());
- }
-
- @Test
- public void get() throws Exception {
- linkedList.add(0, "first");
- linkedList.add(1, "second");
- linkedList.add("third");
- assertEquals("first", linkedList.get(0));
- assertEquals("second", linkedList.get(1));
- assertEquals("third", linkedList.get(2));
- }
-
- @Test
- public void remove() throws Exception {
- linkedList.add(0, "first");
- linkedList.add(1, "second");
- linkedList.add("third");
- linkedList.add("fourth");
- assertEquals("first", linkedList.remove(0));
- assertEquals("third", linkedList.remove(1));
- assertEquals("fourth", linkedList.remove(1));
- assertEquals(1, linkedList.size());
-
- }
-
- @Test
- public void size() throws Exception {
- linkedList.add(0, "first");
- linkedList.add(1, "second");
- linkedList.add("third");
- linkedList.add("fourth");
- assertEquals(4, linkedList.size());
- }
-
- @Test
- public void addFirst() throws Exception {
- linkedList.add("first");
- linkedList.add("second");
- linkedList.addFirst("first first");
- assertEquals("first first", linkedList.get(0));
-
- }
-
- @Test
- public void addLast() throws Exception {
- linkedList.add("first");
- linkedList.add("second");
- linkedList.addLast("last");
- assertEquals("last", linkedList.get(2));
- }
-
- @Test
- public void removeFirst() throws Exception {
- linkedList.add("first");
- linkedList.add("second");
- linkedList.add("third");
- assertEquals("first", linkedList.removeFirst());
- assertEquals("second", linkedList.removeFirst());
- assertEquals(1, linkedList.size());
- assertEquals("third", linkedList.get(0));
- assertEquals("third", linkedList.removeFirst());
- assertEquals(0, linkedList.size());
-
- }
-
- @Test
- public void removeLast() throws Exception {
- linkedList.add("first");
- linkedList.add("second");
- linkedList.add("third");
- assertEquals("third", linkedList.removeLast());
- assertEquals("second", linkedList.removeLast());
- assertEquals("first", linkedList.removeLast());
- assertEquals(0, linkedList.size());
-
- }
-
- @Test
- public void iterator() throws Exception {
- Iterator iterator = linkedList.iterator();
- assertEquals(false,iterator.hasNext());
- linkedList.add("A");
- assertEquals(true,iterator.hasNext());
- assertEquals("A",iterator.next());
- iterator.remove();
- assertEquals(0,linkedList.size());
- }
-
-}
\ No newline at end of file
diff --git a/group18/1049843090/test/com/coding/basic/QueueTest.java b/group18/1049843090/test/com/coding/basic/QueueTest.java
deleted file mode 100644
index 2652d1e214..0000000000
--- a/group18/1049843090/test/com/coding/basic/QueueTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.coding.basic;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Queue Test
- */
-public class QueueTest {
-
- Queue queue;
-
- @Before
- public void setUp() throws Exception {
- queue = new Queue<>();
- }
-
- @After
- public void tearDown() throws Exception {
- queue = null;
- }
-
- @Test
- public void enQueue() throws Exception {
- queue.enQueue("A");
- assertEquals("A",queue.deQueue());
- }
-
- @Test
- public void peek() throws Exception {
- assertEquals(null,queue.peek());
- queue.enQueue("A");
- assertEquals("A",queue.peek());
- }
-
- @Test
- public void deQueue() throws Exception {
- queue.enQueue("A");
- queue.enQueue("B");
- assertEquals("A",queue.deQueue());
-
- }
-
- @Test
- public void isEmpty() throws Exception {
- assertEquals(true,queue.isEmpty());
- queue.enQueue("A");
- assertEquals(false,queue.isEmpty());
- }
-
- @Test
- public void size() throws Exception {
- queue.enQueue("A");
- queue.enQueue("B");
- assertEquals(2,queue.size());
- }
-
-}
\ No newline at end of file
diff --git a/group18/1049843090/test/com/coding/basic/StackTest.java b/group18/1049843090/test/com/coding/basic/StackTest.java
deleted file mode 100644
index e2587ba7f2..0000000000
--- a/group18/1049843090/test/com/coding/basic/StackTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.coding.basic;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Stack Test
- */
-public class StackTest {
- Stack stack;
- @Before
- public void setUp() throws Exception {
- stack = new Stack<>();
- }
-
- @After
- public void tearDown() throws Exception {
- stack = null;
- }
-
- @Test
- public void push() throws Exception {
- stack.push("A");
- assertEquals("A",stack.pop());
- }
-
- @Test
- public void pop() throws Exception {
- stack.push("A");
- stack.push("B");
- stack.push("C");
- assertEquals("C",stack.pop());
- assertEquals("B",stack.pop());
- assertEquals("A",stack.pop());
- assertEquals(0,stack.size());
-
-
- }
-
- @Test
- public void peek() throws Exception {
- stack.push("A");
- stack.push("B");
- stack.push("C");
- assertEquals("C",stack.peek());
-
- }
-
- @Test
- public void isEmpty() throws Exception {
- assertEquals(true,stack.isEmpty());
- stack.push("A");
- assertEquals(false,stack.isEmpty());
- }
-
- @Test
- public void size() throws Exception {
- stack.push("A");
- stack.push("B");
- stack.push("C");
- assertEquals(3,stack.size());
- }
-
-}
\ No newline at end of file
diff --git a/group18/1057617027/.classpath b/group18/1057617027/.classpath
deleted file mode 100644
index d171cd4c12..0000000000
--- a/group18/1057617027/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/group18/1057617027/.gitignore b/group18/1057617027/.gitignore
deleted file mode 100644
index 5e56e040ec..0000000000
--- a/group18/1057617027/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bin
diff --git a/group18/1057617027/.project b/group18/1057617027/.project
deleted file mode 100644
index 3189c0c10d..0000000000
--- a/group18/1057617027/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- 1057617027Learning
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/group18/1057617027/src/com/coding/basic/ArrayList.java b/group18/1057617027/src/com/coding/basic/ArrayList.java
deleted file mode 100644
index 2c11c0a3fa..0000000000
--- a/group18/1057617027/src/com/coding/basic/ArrayList.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.coding.basic;
-
-
-@SuppressWarnings("rawtypes")
-public class ArrayList implements List{
-
- private int size = 0;
-
- private Object[] elementData = new Object[100];
- public void kuorong(int size){
- if(size>elementData.length){
- Object[] elementDataTemp = new Object[size*2];
- System.arraycopy(elementData, 0, elementDataTemp, 0, elementData.length);
- elementData = elementDataTemp;
- }
- }
- public void add(Object o){
- kuorong(size);
- elementData[size] = o;
- ++size;
- }
- public void add(int index, Object o){
- if(index>size||index<0)
- throw new IndexOutOfBoundsException("ȷindexֵ"+size+"ҲС0");
- kuorong(++size);
- System.arraycopy(elementData, index, elementData, index+1, size-index);
- elementData[index] = o;
- }
-
- public Object get(int index){
-
- return elementData[index];
- }
-
- public Object remove(int index){
- if(index>size||index<0)
- throw new IndexOutOfBoundsException("ȷindexֵ"+size+"ҲС0");
-
- System.arraycopy(elementData, index+1, elementData, index, size-index);
- size--;
- return elementData;
- }
-
- public int size(){
- return size;
- }
-
- public Iterator iterator(){
-
- return new myiterator();
- }
- public class myiterator implements Iterator{
- private int nextIndex;
- public boolean hasNext(){
- return nextIndex!=size;
- }
- public Object next(){
- return elementData[nextIndex++];
- }
-
- }
- public static void main(String[] args) {
- ArrayList al = new ArrayList();
-
- al.add(1);
- al.add(2);
- al.add(3);
- al.add(4);
- al.add(2,5);
- al.remove(2);
- for(int i= 0;i<5;i++){
- System.out.println(al.get(i));}
- System.out.println(al.size());
-
- }
-
-}
diff --git a/group18/1057617027/src/com/coding/basic/BinaryTreeNode.java b/group18/1057617027/src/com/coding/basic/BinaryTreeNode.java
deleted file mode 100644
index bcb0a4af65..0000000000
--- a/group18/1057617027/src/com/coding/basic/BinaryTreeNode.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.coding.basic;
-
-public class BinaryTreeNode {
-
- private Object data;
- private BinaryTreeNode left;
- private BinaryTreeNode right;
- private BinaryTreeNode head;
- private BinaryTreeNode node;
- BinaryTreeNode(Object data,BinaryTreeNode left,BinaryTreeNode right){
- this.data = data;
- this.left = left;
- this.right = right;
- }
- public Object getData() {
- return data;
- }
- public void setData(Object data) {
- this.data = data;
- }
- public BinaryTreeNode getLeft() {
- return left;
- }
- public void setLeft(BinaryTreeNode left) {
- this.left = left;
- }
- public BinaryTreeNode getRight() {
- return right;
- }
- public void setRight(BinaryTreeNode right) {
- this.right = right;
- }
-
- public BinaryTreeNode insert(Object o){
- if(node==null){
- node = new BinaryTreeNode(o, null, null);
- }else{
- if(Integer.parseInt(String.valueOf(o))<=Integer.parseInt(String.valueOf(node.data))){
- node.left = insert(node.left,o );
- node = node.left;
- }else{
- node.right = insert(node.right,o);
- node = node.right;
- }
- }
- return node;
- }
- public BinaryTreeNode insert(BinaryTreeNode node,Object o){
- if(node==null){
- node = new BinaryTreeNode(o, null, null);
- }else{
- if(Integer.parseInt(String.valueOf(o))<=Integer.parseInt(String.valueOf(node.data))){
- node.left = insert(node.left,o );
- node.left =node;
- }else{
- node.right = insert(node.right,o );
- node.right =node;
- }
- }
- return node;
- }
-public static void main(String[] args){
- BinaryTreeNode node = new BinaryTreeNode(null, null, null);
-
- System.out.println(node.insert(6).data);
- System.out.println(node.insert(5).data);
- System.out.println(node.insert(11).data);
- System.out.println(node.insert(7).data);
- System.out.println(node.insert(2).data);
- System.out.println(node);
-
-}
-}
\ No newline at end of file
diff --git a/group18/1057617027/src/com/coding/basic/Iterator.java b/group18/1057617027/src/com/coding/basic/Iterator.java
deleted file mode 100644
index 40c0906495..0000000000
--- a/group18/1057617027/src/com/coding/basic/Iterator.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.coding.basic;
-
-public interface Iterator {
-
- public boolean hasNext();
- public Object next();
-}
diff --git a/group18/1057617027/src/com/coding/basic/LinkedList.java b/group18/1057617027/src/com/coding/basic/LinkedList.java
deleted file mode 100644
index b4c3325814..0000000000
--- a/group18/1057617027/src/com/coding/basic/LinkedList.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package com.coding.basic;
-
-public class LinkedList implements List {
-
- private Node head = new Node(null,null);
- private Node last;
- private int size;
- private static class Node{
- Object data;
- Node next;
- Node(Object data,Node next){
- this.data = data;
- this.next = next;
- }
- }
- public void add(Object o){
- if(size==0){
- Node node = new Node(o,null);
- head = node;
- last = node;
- size++;
- }else{
- Node node = new Node(o,null);
- last.next = node;
- last = node;
- size++;
- }
-
- }
- public void add(int index , Object o){
- if(index>size){
- System.out.println(""+index+"ڵǰ"+size);
- }
- Node n = head;
- Node n1 = head;
- for(int i=0;i size || index <0)
- {
- return false;
- }
-
- //Ԫ
- for (int i = 0; i < size; i++) {
- if(o.equals(elementData[i]))
- {
- //ƶԪصĸ
- int nMove = size -index -1;
- if(nMove > 0){
- System.arraycopy(elementData, index, elementData, index+1,nMove);
- elementData[index] = null;
- }
- else {
- return false;
- }
- }
- }
-
- return true;
- }
-
- //Ԫ
- //ֵ:Ƿӳɹ
- public boolean Add(Object obj)
- {
- if (null == obj) {
- throw new IllegalArgumentException("invalid Argument!");
- }
- //array
- ensureCapacityInternal(size + 1);
-
- //βԪ = ֵ
- elementData[size++] = obj;
-
- return true;
- }
-
- public void clear()
- {
- //elementDataԪָNULL,ʹջ
- for (int i = 0; i < elementData.length; i++) {
- elementData[i] = null;
- }
-
- //arrayԪظ
- size = 0;
- }
-
- //ƳarrayеԪ
- public boolean remove(Object obj)
- {
- //elementData,Ԫ
- for (int index = 0; index < size; index++) {
- if(obj.equals(elementData[index]))//Ƿ
- {
- fastRemove(index);
- return true;
- }
- }
- return false;
- }
-
- private void fastRemove(int index) {
- //ƶԪصĸ
- int numMoved = size - index - 1;
- if (numMoved > 0)
- //indexԴǰƶ
- System.arraycopy(elementData, index+1, elementData, index,numMoved);
- elementData[--size] = null;
- }
-
- //ԪܴС
- public int size() {
- return size;
- }
-
- public Object get(int index) {
- //У
- if(index > size || index < 0)
- throw new IllegalArgumentException();
-
- return elementData[index];
- }
-
- //漰ݿռ,ʱȲ
- private void ensureCapacityInternal(int minCapacity) {
- //,ǰʱ,Ƿ˵ǰij
- System.out.println("element data length is "+elementData.length);
- if(minCapacity - elementData.length > 0)
- {
- //Ϊǰ1.5
- int oldCapacity = elementData.length;
- int newCapacity = oldCapacity *3/2;
-
- //ڲ,elementDataԪؿ
- elementData = Arrays.copyOf(elementData, newCapacity);
- }
- }
-}
diff --git a/group18/1078285863/javaStudy/src/simpleLinkedList/SimpleLinkedList.java b/group18/1078285863/javaStudy/src/simpleLinkedList/SimpleLinkedList.java
deleted file mode 100644
index 0f11532723..0000000000
--- a/group18/1078285863/javaStudy/src/simpleLinkedList/SimpleLinkedList.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package simpleLinkedList;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import javax.sound.sampled.Line;
-
-public class SimpleLinkedList {
- //LinkedList
- private int size = 0;
- private Node head = null;
- private Node tail = null;
-
- private static class Node{
- Object data;
- Node next;//ָһԪ
- Node prev; //ָǰһԪ
- }
-
- public void add(Object o){
- addLast(o);
- }
- public void add(int index , Object o){
- //ҵindexλõԪ
- Node tmp = null;
- for (int i = 0; i < index; i++) {
- tmp = tmp.next;
- }
-
- Node pre = tmp.prev;
- Node next = tmp.next;
-
- if (null == pre) {
- addFirst(o); //ͷ
- }
- else if(null == next){
- addLast(o); //β
- }
- else {
- add(o);
- }
- }
- public Object get(int index){
- if (index > size || index <0) {
- throw new IllegalArgumentException();
- }
-
- Node temp = null;
- for(int i=0;i queueList = new LinkedList();
- public void enQueue(Object o){
- queueList.add(o);
- }
-
- public Object deQueue(){
- return queueList.removeFirst();
- }
-
- public boolean isEmpty(){
- return queueList.isEmpty();
- }
-
- public int size(){
- return queueList.size();
- }
-}
\ No newline at end of file
diff --git a/group18/1078285863/javaStudy/src/simpleStack/SimpleStack.java b/group18/1078285863/javaStudy/src/simpleStack/SimpleStack.java
deleted file mode 100644
index bfbea7b1db..0000000000
--- a/group18/1078285863/javaStudy/src/simpleStack/SimpleStack.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package simpleStack;
-
-import java.util.ArrayList;
-
-public class SimpleStack {
-private ArrayList elementData = new ArrayList();
-
- public void push(Object o){
- elementData.add(o);
- }
-
- public Object pop(){
- //ж϶ǷΪ
- Object obj = peek();
- if(obj != null)
- {
- elementData.remove(obj);
- return obj;
- }
- else {
- return null;
- }
- }
-
- public Object peek(){
- if(elementData.isEmpty()){
- return null;
- }
- else {
- int lastIndex = elementData.size() -1;
- Object obj = elementData.get(lastIndex);
- return obj;
- }
-
- }
- public boolean isEmpty(){
- boolean bEmpty = false;
- bEmpty = elementData.isEmpty()?true:false;
- return bEmpty;
- }
- public int size(){
- return elementData.size();
- }
-}
diff --git a/group18/1159828430/20160305/src/com/coding/basic/LinkedList.java b/group18/1159828430/20160305/src/com/coding/basic/LinkedList.java
deleted file mode 100644
index ef3f794cd5..0000000000
--- a/group18/1159828430/20160305/src/com/coding/basic/LinkedList.java
+++ /dev/null
@@ -1,373 +0,0 @@
-package com.coding.basic;
-
-import java.util.Iterator;
-
-/**
- * @author Scholar
- * @Time:2017年3月6日 下午9:45:54
- * @version 1.0
- */
-public class LinkedList implements List {
-
- private Node head;
- private int size;
-
- public boolean add(Object o){
- addLast(o);
- return true;
-
- }
- public void add(int index , Object o){
- checkPositionIndex(index);
- if (index == 0) {
- addFirst(o);
- } else if (index == size) {
- addLast(o);
- } else {
- Node x = head;
- for (int i = 0; i < index - 2; i++) {
- x = x.next;
- }
- Node temp = new Node(o,x.next);
- x.next = temp;
- }
- size++;
- }
- public Object get(int index){
- checkElementIndex(index);
- Node x = head;
- for (int i = 0; i < index; i++) {
- x = x.next;
- }
- return x.data;
- }
- @SuppressWarnings("unused")
- public Object remove(int index){
- checkElementIndex(index);
- Object element = null;
- if (index == 0) {
- Node removeNode = head;
- head = head.next;
- element = removeNode.data;
- removeNode = null;
- } else {
- checkElementIndex(index - 1);
- Node x = head;
- for (int i = 0; i < index - 1; i++) {
- x = x.next;
- }
- Node removeNode = x.next;
- x.next = removeNode.next;
- element = removeNode.data;
- removeNode = null;
- }
- size--;
- return element;
- }
-
- public int size(){
- return size;
- }
-
- public void addFirst(Object o){
- Node temp = head;
- Node newNode = new Node(o,temp);
- head = newNode;
- size++;
- }
- public void addLast(Object o){
- Node temp = new Node(o, null);
- if (size == 0) {
- head = temp;
- } else {
- Node x = head;
- while (x.next != null) {
- x = x.next;
- }
- x.next = temp;
- }
- size++;
- }
- public Object removeFirst(){
- Object element = null;
- if (size != 0) {
- element = head.data;
- head.data = null;
-
- Node next = head.next;
- head.next = null;
- head = next;
- size--;
- }
- return element;
- }
- public Object removeLast(){
- Object element = null;
- if (size != 0) {
- if (head.next == null) {
- element = head.data;
- head.data = null;
- } else {
- Node x = head;
- for (int i = 0; i < size - 2; i++) {
- x = x.next;
- }
- Node removeNode = x.next;
- x.next = null;
- element = removeNode.data;
- removeNode = null;
- }
- size--;
- }
- return element;
- }
- public Iterator> iterator(){
- return new LinkedListIterator();
- }
-
- //检查下标是否合法
- private void checkElementIndex(int index){
- if (!isElementIndex(index)) {
- throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
- }
- }
-
- @SuppressWarnings("unused")
- private void checkPositionIndex(int index){
- if (!isPositionIndex(index)) {
- throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
- }
- }
-
- //检查该参数是否为现有元素的索引。
- private boolean isElementIndex(int index) {
- return index >= 0 && index < size;
- }
-
- //检查参数是否是迭代器或添加操作的有效位置的索引
- private boolean isPositionIndex(int index) {
- return index >= 0 && index <= size;
- }
-
- @SuppressWarnings("unused")
- private static class Node{
- Object data;
- Node next;
- Node(Object data, Node next){
- this.data = data;
- this.next = next;
- }
- }
-
- private class LinkedListIterator implements Iterator