diff --git a/group24/494800949/.gitignore b/group24/494800949/.gitignore new file mode 100644 index 0000000000..a50868a433 --- /dev/null +++ b/group24/494800949/.gitignore @@ -0,0 +1,4 @@ +.idea/* +*.iml +build/* +.gradle/* diff --git a/group24/494800949/build.gradle b/group24/494800949/build.gradle new file mode 100644 index 0000000000..e88b275214 --- /dev/null +++ b/group24/494800949/build.gradle @@ -0,0 +1,29 @@ +group 'com.hpe' +version '1.0' + +buildscript { + repositories { + mavenCentral() + } +} +apply plugin: 'java' +apply plugin: 'idea' + +sourceCompatibility = 1.8 +sourceCompatibility = 1.8 + +repositories { + mavenCentral() +} + +dependencies{ + compile group: 'junit', name: 'junit', version: '4.11' +} +gradle.projectsEvaluated { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" + options.encoding = "UTF-8" + } +} + +defaultTasks "build" \ No newline at end of file diff --git a/group24/494800949/src/main/java/com/coding/weak1/ArrayList.java b/group24/494800949/src/main/java/com/coding/weak1/ArrayList.java new file mode 100644 index 0000000000..b878b04045 --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/ArrayList.java @@ -0,0 +1,102 @@ +package com.coding.weak1; + +public class ArrayList implements List { + + private int size = 0; + + private Object[] elementData = new Object[100]; + + public void add(Object o){ + ensureCapcity(size + 1); + elementData[size++] = o; + } + + /** + * 当数组长度不够时进行扩容 + */ + private void ensureCapcity(int requireSize){ + int oldCapacity = elementData.length; + int newCapacity ; + if(oldCapacity < requireSize){ + newCapacity = oldCapacity + (oldCapacity >> 1); + + if(newCapacity < 0){ + newCapacity = Integer.MAX_VALUE; + } + + if(newCapacity > Integer.MAX_VALUE - 8){ + newCapacity = Integer.MAX_VALUE; + } + + Object[] elementDataNew = new Object[newCapacity]; + System.arraycopy(elementData, 0, elementDataNew, 0, oldCapacity); + elementData = elementDataNew; + } + } + + + public void add(int index, Object o){ + indexCheckForAdd(index); + ensureCapcity(index + 1); + Object[] newElementData = new Object[elementData.length]; + if(index > 0) + System.arraycopy(elementData, 0, newElementData, 0, index-1); + System.arraycopy(elementData, index, newElementData, index+1, size-index); + elementData = newElementData; + elementData[index] = o; + size++; + } + + + private void indexCheckForAdd(int index) { + if(index < 0 || index >= size-1){ + throw new IndexOutOfBoundsException("max index is: "+(size-1)); + } + } + + public Object get(int index){ + indexCheck(index); + return elementData[index]; + } + + private void indexCheck(int index) { + if(index < 0 || index > size-1){ + throw new IndexOutOfBoundsException("max index is: "+(size-1)); + } + } + + public Object remove(int index){ + indexCheck(index); + Object obj = elementData[index]; + System.arraycopy(elementData, index+1, elementData, index, size-index-1); + elementData[size--] = null; + return obj; + } + + public int size(){ + return size; + } + + public Iterator iterator(){ + return new ListIter(); + } + + private class ListIter implements Iterator{ + + private int cursor; + + @Override + public boolean hasNext() { + return cursor < size; + } + + @Override + public Object next() { + int index = cursor; + if(index >= size) + throw new IndexOutOfBoundsException(); + cursor++; + return elementData[index]; + } + } +} diff --git a/group24/494800949/src/main/java/com/coding/weak1/BinaryTreeNode.java b/group24/494800949/src/main/java/com/coding/weak1/BinaryTreeNode.java new file mode 100644 index 0000000000..8676a519d8 --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/BinaryTreeNode.java @@ -0,0 +1,32 @@ +package com.coding.weak1; + +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; + } + +} diff --git a/group24/494800949/src/main/java/com/coding/weak1/Iterator.java b/group24/494800949/src/main/java/com/coding/weak1/Iterator.java new file mode 100644 index 0000000000..59ec891396 --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/Iterator.java @@ -0,0 +1,7 @@ +package com.coding.weak1; + +public interface Iterator { + public boolean hasNext(); + public Object next(); + +} diff --git a/group24/494800949/src/main/java/com/coding/weak1/LinkedList.java b/group24/494800949/src/main/java/com/coding/weak1/LinkedList.java new file mode 100644 index 0000000000..e1dc589104 --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/LinkedList.java @@ -0,0 +1,225 @@ +package com.coding.weak1; + + +public class LinkedList implements List { + + private Node head; + private int size; + public void add(Object o){ + addLast(o); + } + public void add(int index , Object o){ + if (index < 0 || index > size){ + throw new IndexOutOfBoundsException("index: "+index); + } + if (index == size){ + addLast(o); + }else if(index == 0) { + addFirst(o); + }else { + Node preNode = node(index - 1); + Node indexNode = node(index); + preNode.next = new Node(o, indexNode); + size++; + } + + } + + + public Object get(int index){ + Node node = node(index); + return node.data; + } + + private Node node(int index){ + if(index < 0 || index >= size){ + throw new IndexOutOfBoundsException("index: "+index + ",size: "+size); + } + Node node = head; + for (int i = 0; i < size; i++ ){ + if(i == index){ + return node; + } + node = node.next; + } + return null; + } + + public Object remove(int index){ + if(index < 0 || index >= size){ + throw new IndexOutOfBoundsException("index: "+index + ",size: "+size); + } + if(index == 0){ + return removeFirst(); + }else if(index == size-1){ + return removeLast(); + } + Node indexNode = node(index); + Node prev = node(index - 1); + Node next = node(index + 1); + prev.next = next; + size--; + return indexNode.data; + } + + public int size(){ + return size; + } + + public void addFirst(Object o){ + if (head == null) + head = new Node(o, null); + else { + Node node = new Node(o, head); + head = node; + } + size++; + } + + + public void addLast(Object o){ + if(head == null){ + head = new Node(o, null); + }else { + Node node = head; + for(int i = 0; i < size-1; i++){ + node = node.next; + } + node.next = new Node(o, null); + } + size++; + } + + public Object removeFirst(){ + if(head == null) + return null; + Node oldFirst = head; + head = oldFirst.next; + size--; + return oldFirst; + } + public Object removeLast(){ + if(head == null) + return null; + Node oldLast = node(size - 1); + Node preLast; + if (size - 2 >= 0){ + preLast = node(size - 2); + preLast.next = null; + } else { + head = null; + } + size--; + return oldLast; + } + public Iterator iterator(){ + + return new LinkedListIter(); + } + + private class LinkedListIter implements Iterator{ + + private int cursor; + + @Override + public boolean hasNext() { + return cursor++ < size; + } + + @Override + public Object next() { + int index = cursor; + if(index > size) + throw new IndexOutOfBoundsException(); + Node node = node(index); + cursor++; + return node.data; + } + } + + private static class Node{ + Object data; + Node next; + + public Node(Object data, Node next) { + this.data = data; + this.next = next; + } + } + + /** + * 把该链表逆置 + * 例如链表为 3->7->10 , 逆置后变为 10->7->3 + */ + public void reverse(){ + + } + + /** + * 删除一个单链表的前半部分 + * 例如:list = 2->5->7->8 , 删除以后的值为 7->8 + * 如果list = 2->5->7->8->10 ,删除以后的值为7,8,10 + + */ + public void removeFirstHalf(){ + + } + + /** + * 从第i个元素开始, 删除length 个元素 , 注意i从0开始 + * @param i + * @param length + */ + public void remove(int i, int length){ + + } + /** + * 假定当前链表和list均包含已升序排列的整数 + * 从当前链表中取出那些list所指定的元素 + * 例如当前链表 = 11->101->201->301->401->501->601->701 + * listB = 1->3->4->6 + * 返回的结果应该是[101,301,401,601] + * @param list + */ + public static int[] getElements(LinkedList list){ + return null; + } + + /** + * 已知链表中的元素以值递增有序排列,并以单链表作存储结构。 + * 从当前链表中中删除在list中出现的元素 + + * @param list + */ + + public void subtract(LinkedList list){ + + } + + /** + * 已知当前链表中的元素以值递增有序排列,并以单链表作存储结构。 + * 删除表中所有值相同的多余元素(使得操作后的线性表中所有元素的值均不相同) + */ + public void removeDuplicateValues(){ + + } + + /** + * 已知链表中的元素以值递增有序排列,并以单链表作存储结构。 + * 试写一高效的算法,删除表中所有值大于min且小于max的元素(若表中存在这样的元素) + * @param min + * @param max + */ + public void removeRange(int min, int max){ + + } + + /** + * 假设当前链表和参数list指定的链表均以元素依值递增有序排列(同一表中的元素值各不相同) + * 现要求生成新链表C,其元素为当前链表和list中元素的交集,且表C中的元素有依值递增有序排列 + * @param list + */ + public LinkedList intersection( LinkedList list){ + return null; + } +} diff --git a/group24/494800949/src/main/java/com/coding/weak1/List.java b/group24/494800949/src/main/java/com/coding/weak1/List.java new file mode 100644 index 0000000000..a537a11d7f --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/List.java @@ -0,0 +1,11 @@ +package com.coding.weak1; + +public interface List { + public void add(Object o); + public void add(int index, Object o); + public Object get(int index); + public Object remove(int index); + public int size(); + + public Iterator iterator(); +} diff --git a/group24/494800949/src/main/java/com/coding/weak1/Queue.java b/group24/494800949/src/main/java/com/coding/weak1/Queue.java new file mode 100644 index 0000000000..e3bf0fdadf --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/Queue.java @@ -0,0 +1,22 @@ +package com.coding.weak1; + +public class Queue { + + private ArrayList elementData = new ArrayList(); + + public void enQueue(Object o){ + elementData.add(o); + } + + public Object deQueue(){ + return elementData.remove(0); + } + + public boolean isEmpty(){ + return elementData.size() == 0; + } + + public int size(){ + return elementData.size(); + } +} diff --git a/group24/494800949/src/main/java/com/coding/weak1/Stack.java b/group24/494800949/src/main/java/com/coding/weak1/Stack.java new file mode 100644 index 0000000000..d1088e7db0 --- /dev/null +++ b/group24/494800949/src/main/java/com/coding/weak1/Stack.java @@ -0,0 +1,29 @@ +package com.coding.weak1; + +import java.util.NoSuchElementException; + +public class Stack { + private ArrayList elementData = new ArrayList(); + + public void push(Object o){ + elementData.add(o); + } + + public Object pop(){ + if(isEmpty()){ + throw new NoSuchElementException(); + } + return elementData.remove(elementData.size() - 1); + } + + public Object peek(){ + return elementData.get(elementData.size()-1); + } + public boolean isEmpty(){ + return elementData.size() == 0; + } + + public int size(){ + return elementData.size(); + } +} diff --git a/group24/494800949/src/test/java/com/coding/weak1/ArrayListTest.java b/group24/494800949/src/test/java/com/coding/weak1/ArrayListTest.java new file mode 100644 index 0000000000..10e6113de8 --- /dev/null +++ b/group24/494800949/src/test/java/com/coding/weak1/ArrayListTest.java @@ -0,0 +1,126 @@ +package com.coding.weak1; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +/** + * Created by Administrator on 2017/3/11 0011. + */ +public class ArrayListTest{ + + @Rule + public ExpectedException thrown= ExpectedException.none(); + + private List list = new ArrayList(); + @Before + public void setup(){ + + } + @Test + public void testAdd() throws Exception { + List list = new ArrayList(); + Assert.assertTrue(list.size() == 0); + list.add(100); + Assert.assertTrue(list.size()==1); + + for(int i = 0; i < 100; i++){ + list.add(i); + } + + Assert.assertTrue(list.size() == 101 ); + + list = new ArrayList(); + for(int i = 0; i < 1000000; i++){ + list.add(i); + } + Assert.assertTrue(list.size() == 1000000); + Assert.assertTrue((int) list.get(1) == 1); + Assert.assertTrue((int)list.get(100) == 100); + Assert.assertTrue((int)list.get(1000) == 1000); + Assert.assertTrue((int) list.get(9999) == 9999); + Assert.assertTrue((int) list.get(999999) == 999999); + } + + @Test + public void testAdd1() throws Exception { + List list = new ArrayList(); + Assert.assertTrue(list.size() == 0); + for(int i = 0; i < 10; i++){ + list.add(i); + } + list.add(3, 9); + Assert.assertEquals(list.get(3), 9); + Assert.assertEquals(list.get(4), 3); + Assert.assertTrue(list.size() == 11); + list = new ArrayList(); + for(int i = 0; i < 10; i++){ + list.add(i); + } + + thrown.expect(IndexOutOfBoundsException.class); + list.add(10, 10); + } + + + @Test + public void indexCheckForAdd2(){ + List list = new ArrayList(); + for(int i = 0; i < 10; i++){ + list.add(i); + } + thrown.expect(IndexOutOfBoundsException.class); + list.add(10,10); + } + + + @Test + public void indexCheck1(){ + List list = new ArrayList(); + for(int i = 0; i < 10; i++){ + list.add(i); + } + thrown.expect(IndexOutOfBoundsException.class); + list.get(-1); + } + + + @Test + public void testGet() throws Exception { + List list = new ArrayList(); + for(int i = 0; i < 10; i++){ + list.add(i); + } + Assert.assertEquals(list.get(1), 1); + Assert.assertEquals(list.get(9), 9); + } + + @Test + public void testRemove() throws Exception { + List list = new ArrayList(); + for (int i = 0; i < 10; i++){ + list.add(i); + } + list.remove(1); + Assert.assertEquals(list.get(1), 2); + } + + + @Test + public void testIter() { + List list = new ArrayList(); + for (int i = 0; i < 5; i++){ + list.add(i); + } + Iterator iterator = list.iterator(); + Assert.assertTrue(iterator.hasNext()); + Assert.assertEquals(iterator.next(), 0); + Assert.assertEquals(iterator.next(), 1); + Assert.assertEquals(iterator.next(), 2); + Assert.assertEquals(iterator.next(), 3); + Assert.assertEquals(iterator.next(), 4); + Assert.assertTrue(!iterator.hasNext()); + } +} \ No newline at end of file diff --git a/group24/494800949/src/test/java/com/coding/weak1/LinkedListTest.java b/group24/494800949/src/test/java/com/coding/weak1/LinkedListTest.java new file mode 100644 index 0000000000..a505f143f0 --- /dev/null +++ b/group24/494800949/src/test/java/com/coding/weak1/LinkedListTest.java @@ -0,0 +1,156 @@ +package com.coding.weak1; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +/** + * Created by Administrator on 2017/3/11 0011. + */ +public class LinkedListTest { + + @Rule + public ExpectedException thrown = ExpectedException.none(); + @Test + public void testAdd() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.add("ssss"); + linkedList.add("ssss1"); + linkedList.add("ssss2"); + linkedList.add("ssss3"); + linkedList.add("ssss4"); + linkedList.add("ssss5"); + Assert.assertEquals(linkedList.size(), 6); + Assert.assertEquals(linkedList.get(0), "ssss"); + Assert.assertEquals(linkedList.get(1), "ssss1"); + Assert.assertEquals(linkedList.get(3), "ssss3"); + Assert.assertEquals(linkedList.get(5), "ssss5"); + } + + @Test + public void testAdd1() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.add("ssss"); + linkedList.add("ssss1"); + linkedList.add("ssss2"); + linkedList.add(1, "ssss3"); + Assert.assertEquals(linkedList.get(0), "ssss"); + Assert.assertEquals(linkedList.get(1), "ssss3"); + Assert.assertEquals(linkedList.get(2), "ssss1"); + Assert.assertEquals(linkedList.get(3), "ssss2"); + } + + @Test + public void testGet() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.addFirst("ssss"); + linkedList.addFirst("ssss1"); + linkedList.addFirst("ssss2"); + linkedList.addFirst("ssss3"); + linkedList.addFirst("ssss4"); + linkedList.addFirst("ssss5"); + Assert.assertEquals(linkedList.size(), 6); + Assert.assertEquals(linkedList.get(0), "ssss5"); + Assert.assertEquals(linkedList.get(1), "ssss4"); + Assert.assertEquals(linkedList.get(3), "ssss2"); + Assert.assertEquals(linkedList.get(5), "ssss"); +// thrown.expect(IndexOutOfBoundsException.class); +// linkedList.get(-1); + thrown.expect(IndexOutOfBoundsException.class); + linkedList.get(6); + } + + @Test + public void testRemove() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.add("ssss"); + linkedList.add("ssss1"); + linkedList.add("ssss2"); + linkedList.add("ssss3"); + linkedList.add("ssss4"); + linkedList.add("ssss5"); + String ret = (String)linkedList.remove(3); + Assert.assertEquals(ret, "ssss3"); + Assert.assertEquals(linkedList.size(), 5); + Assert.assertEquals(linkedList.get(3),"ssss4"); + Assert.assertEquals(linkedList.get(2),"ssss2"); +// + Assert.assertEquals(linkedList.size(), 5); + linkedList.remove(4); + Assert.assertEquals(linkedList.get(3), "ssss4"); + } + + @Test + public void testSize() throws Exception { + LinkedList linkedList = new LinkedList(); + Assert.assertEquals(linkedList.size(), 0); + } + + @Test + public void testAddFirst() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.addFirst("ssss"); + linkedList.addFirst("ssss1"); + linkedList.addFirst("ssss2"); + linkedList.addFirst("ssss3"); + linkedList.addFirst("ssss4"); + linkedList.addFirst("ssss5"); + Assert.assertEquals(linkedList.size(), 6); + } + + @Test + public void testAddLast() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.addLast("ssss"); + linkedList.addLast("ssss1"); + linkedList.addLast("ssss1"); + linkedList.addLast("ssss1"); + linkedList.addLast("ssss1"); + linkedList.addLast("ssss1"); + Assert.assertEquals(linkedList.size(), 6); + } + + @Test + public void testRemoveFirst() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.add("ssss"); + linkedList.add("ssss1"); + Assert.assertEquals(linkedList.size(), 2); + linkedList.removeFirst(); + Assert.assertEquals(linkedList.size(), 1); + Assert.assertEquals(linkedList.get(0), "ssss1"); + linkedList.removeFirst(); + Assert.assertEquals(linkedList.size(), 0); + thrown.expect(IndexOutOfBoundsException.class); + Assert.assertEquals(linkedList.get(0), "ssss1"); + } + + @Test + public void testRemoveLast() throws Exception { + LinkedList linkedList = new LinkedList(); + linkedList.add("ssss"); + linkedList.add("ssss1"); + linkedList.add("ssss2"); + Assert.assertEquals(linkedList.size(), 3); + Assert.assertEquals(linkedList.get(2), "ssss2"); + linkedList.removeLast(); + Assert.assertEquals(linkedList.size(), 2); + thrown.expect(IndexOutOfBoundsException.class); + Assert.assertEquals(linkedList.get(2), "ssss2"); + } + + @Test + public void testIterator() throws Exception { + List list = new LinkedList(); + list.add("ssss"); + list.add("ssss1"); + list.add("ssss2"); + Iterator iterator = list.iterator(); + Assert.assertEquals(iterator.next(), "ssss"); + Assert.assertEquals(iterator.next(), "ssss1"); + Assert.assertEquals(iterator.next(), "ssss2"); + thrown.expect(IndexOutOfBoundsException.class); + Assert.assertEquals(iterator.next(), "ssss2"); + } +} \ No newline at end of file diff --git a/group24/494800949/src/test/java/com/coding/weak1/QueueTest.java b/group24/494800949/src/test/java/com/coding/weak1/QueueTest.java new file mode 100644 index 0000000000..1410e6f595 --- /dev/null +++ b/group24/494800949/src/test/java/com/coding/weak1/QueueTest.java @@ -0,0 +1,47 @@ +package com.coding.weak1; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by Administrator on 2017/3/12 0012. + */ +public class QueueTest { + + @Test + public void testEnQueue() throws Exception { + Queue queue = new Queue(); + queue.enQueue("java"); + queue.enQueue("python"); + Assert.assertEquals(queue.size(), 2); + Assert.assertEquals(queue.isEmpty(), false); + Assert.assertEquals(queue.deQueue(), "java"); + } + + @Test + public void testDeQueue() throws Exception { + Queue queue = new Queue(); + queue.enQueue("java"); + queue.enQueue("python"); + Assert.assertEquals(queue.size(), 2); + Assert.assertEquals(queue.isEmpty(), false); + Assert.assertEquals(queue.deQueue(), "java"); + Assert.assertEquals(queue.deQueue(), "python"); + } + + @Test + public void testIsEmpty() throws Exception { + Queue queue = new Queue(); + Assert.assertEquals(queue.isEmpty(), true); + queue.enQueue("java"); + Assert.assertEquals(queue.isEmpty(), false); + } + + @Test + public void testSize() throws Exception { + Queue queue = new Queue(); + Assert.assertEquals(queue.size(), 0); + queue.enQueue("java"); + Assert.assertEquals(queue.size(), 1); + } +} \ No newline at end of file diff --git a/group24/494800949/src/test/java/com/coding/weak1/StackTest.java b/group24/494800949/src/test/java/com/coding/weak1/StackTest.java new file mode 100644 index 0000000000..9bbb965c5e --- /dev/null +++ b/group24/494800949/src/test/java/com/coding/weak1/StackTest.java @@ -0,0 +1,68 @@ +package com.coding.weak1; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by Administrator on 2017/3/12 0012. + */ +public class StackTest { + + @Test + public void testPush() throws Exception { + Stack stack = new Stack(); + Assert.assertEquals(stack.size(), 0); + stack.push("java"); + stack.push("c++"); + Assert.assertEquals(stack.size(), 2); + Assert.assertEquals(stack.peek(), "c++"); + } + + @Test + public void testPop() throws Exception { + Stack stack = new Stack(); + stack.push("java"); + stack.push("c++"); + stack.push("c#"); + stack.push("php"); + stack.push("python"); + Assert.assertEquals(stack.pop(), "python"); + Assert.assertEquals(stack.pop(), "php"); + Assert.assertEquals(stack.pop(), "c#"); + Assert.assertEquals(stack.pop(), "c++"); + Assert.assertEquals(stack.pop(), "java"); + Assert.assertEquals(stack.size(), 0); + } + + @Test + public void testPeek() throws Exception { + Stack stack = new Stack(); + stack.push("java"); + stack.push("c++"); + stack.push("c#"); + stack.push("php"); + stack.push("python"); + Assert.assertEquals(stack.peek(), "python"); + Assert.assertEquals(stack.peek(), "python"); + Assert.assertEquals(stack.size(), 5); + } + + @Test + public void testIsEmpty() throws Exception { + Stack stack = new Stack(); + Assert.assertEquals(stack.isEmpty(), true); + stack.push(1); + Assert.assertEquals(stack.isEmpty(), false); + } + + @Test + public void testSize() throws Exception { + Stack stack = new Stack(); + stack.push("java"); + stack.push("c++"); + stack.push("c#"); + stack.push("php"); + stack.push("python"); + Assert.assertEquals(stack.size(), 5); + } +} \ No newline at end of file