Skip to content

Commit

Permalink
Merge pull request #155 from BlindingDark/master
Browse files Browse the repository at this point in the history
第 26 组提交
  • Loading branch information
onlyliuxin authored Apr 6, 2017
2 parents d9e5387 + 0cfb220 commit c247cbb
Show file tree
Hide file tree
Showing 125 changed files with 7,743 additions and 732 deletions.
8 changes: 8 additions & 0 deletions group26/1515345281/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Junit4"/>
<classpathentry kind="lib" path="lib/jdom-2.0.6.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
6 changes: 4 additions & 2 deletions group26/1515345281/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/bin
/.project/.classpath
/bin
/.project/.classpath
/.settings
/lib
17 changes: 17 additions & 0 deletions group26/1515345281/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>1515345281Learning</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
1 change: 1 addition & 0 deletions group26/1515345281/src/Collection/blog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
浅谈CPU,内存,硬盘,指令之间的关系http://blog.csdn.net/sjshenjian/article/details/68946823
138 changes: 69 additions & 69 deletions group26/1515345281/src/week1/collection/test/ArrayListTest.java
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
package week1.test;

import static org.junit.Assert.*;

import org.junit.Test;

import week1.collection.ArrayList;
import week1.collection.Iterator;

public class ArrayListTest {

private ArrayList list=new ArrayList();

@Test
public void testAddObject(){
list.add(1);
assertEquals(1 , list.get(0));
}

@Test
public void testAddIndexObject(){
list.add("aa");
list.add("bb");
list.add(0,"cc");
assertEquals("cc",list.get(0));
try{
list.add(-1,"pp");
fail("- can't be index");

list.add(list.size()+100,"bb");
fail("index should <= size");

}catch(Exception ex){

}
}

@Test
public void testGetObject(){
list.add(1);
assertEquals(1,list.get(0));
}

@Test
public void testRemoveObject(){
list.add(1);
list.add(2);
list.add(3);
list.remove(0);
list.remove(2);
assertEquals(2,list.get(0));
}

@Test
public void testSize(){
assertEquals(0,list.size());
}

@Test
public void testIterator(){
list.add(1);
list.add(2);
list.add(3);
Iterator it=list.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
}
}
package week1.collection.test;

import static org.junit.Assert.*;

import org.junit.Test;

import week1.collection.ArrayList;
import week1.collection.Iterator;

public class ArrayListTest {

private ArrayList list=new ArrayList();

@Test
public void testAddObject(){
list.add(1);
assertEquals(1 , list.get(0));
}

@Test
public void testAddIndexObject(){
list.add("aa");
list.add("bb");
list.add(0,"cc");
assertEquals("cc",list.get(0));
try{
list.add(-1,"pp");
fail("- can't be index");

list.add(list.size()+100,"bb");
fail("index should <= size");

}catch(Exception ex){

}
}

@Test
public void testGetObject(){
list.add(1);
assertEquals(1,list.get(0));
}

@Test
public void testRemoveObject(){
list.add(1);
list.add(2);
list.add(3);
list.remove(0);
list.remove(2);
assertEquals(2,list.get(0));
}

@Test
public void testSize(){
assertEquals(0,list.size());
}

@Test
public void testIterator(){
list.add(1);
list.add(2);
list.add(3);
Iterator it=list.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package week1.test;

import static org.junit.Assert.*;

import org.junit.Test;

import week1.collection.BinaryTreeNode;

public class BinarySearchTreeTest {

private BinaryTreeNode root=new BinaryTreeNode(5);

@Test
public void testInsert(){
root.insert(2);
root.insert(2);
root.insert(7);
root.insert(1);
root.insert(4);
root.insert(3);
assertEquals(3,root.getLeft().getRight().getLeft().getData());
}
}
package week1.collection.test;

import static org.junit.Assert.*;

import org.junit.Test;

import week1.collection.BinaryTreeNode;

public class BinarySearchTreeTest {

private BinaryTreeNode root=new BinaryTreeNode(5);

@Test
public void testInsert(){
root.insert(2);
root.insert(2);
root.insert(7);
root.insert(1);
root.insert(4);
root.insert(3);
assertEquals(3,root.getLeft().getRight().getLeft().getData());
}
}
Loading

0 comments on commit c247cbb

Please sign in to comment.