Skip to content

Commit 54fe271

Browse files
committed
update group08
1 parent d4a25d6 commit 54fe271

File tree

33 files changed

+286
-0
lines changed

33 files changed

+286
-0
lines changed

group08/108621969/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# About Me
2+
1. 姓名: 张加涛
3+
2. 性别: 男
4+
3. 状态: 实习
5+
4. 年龄: 22
6+
5. 职业: web前端
7+
6. 坐标: 上海浦东

group08/1144989424/Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### 目录说明
2+
3+
个人目录,他人勿动
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### 第一次作业:
2+
1. 实现ArrayList, LinkedList, Queue, Stack
3+
2. 有余力的同学可以实现 BinaryTree 和Iterator
4+
3. 写一篇文章,建议: 描述CPU,内存, 硬盘,指令之间的关系。
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package basic;
2+
3+
public class MyArrayList implements MyList {
4+
5+
private int size = 0;
6+
7+
private Object[] elementData = new Object[10];
8+
9+
/**
10+
* 往集合中添加一个元素
11+
*/
12+
public void add(Object o){
13+
int length = elementData.length;
14+
//1.比较元素个数和数组大小,判断是否需要扩大数组
15+
if(size == length){
16+
expandArray();
17+
}
18+
//2.直接赋值给size,即最后一个元素
19+
elementData[size] = o;
20+
size++;
21+
}
22+
23+
/**
24+
* 往集合指定位置添加一个元素,该位置和其之后的元素向后移动一位。
25+
* 位置不合法时,抛出异常。
26+
*/
27+
public void add(int index, Object o){
28+
int length = elementData.length;
29+
//0.先对index的值进行判断,不能小于0,且不能大于size
30+
if(index < 0 || index > size){
31+
throw new IndexOutOfBoundsException("插入的下标越界了:"+"插入的下标为:"+index+"集合大小为:"+size);
32+
}
33+
//1.比较元素个数和数组大小,判断是否需要扩大数组
34+
if(size == length){
35+
expandArray();
36+
}
37+
//2.移动index之后的数组元素
38+
for(int i = size; i > index; i--){
39+
elementData[i] = elementData[i-1];
40+
}
41+
elementData[index] = o;
42+
size++;
43+
}
44+
45+
public Object get(int index){
46+
return null;
47+
}
48+
49+
public Object remove(int index){
50+
return null;
51+
}
52+
53+
public int size(){
54+
return -1;
55+
}
56+
57+
public MyIterator iterator(){
58+
return null;
59+
}
60+
61+
private void expandArray(){
62+
int length = elementData.length;
63+
Object [] newArr = new Object[length * 2];
64+
for(int i = 0; i < length; i++){
65+
newArr[i] = elementData[i];
66+
}
67+
elementData = newArr;
68+
}
69+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package basic;
2+
3+
public class MyBinaryTreeNode {
4+
5+
private Object data;
6+
private MyBinaryTreeNode left;
7+
private MyBinaryTreeNode right;
8+
9+
public Object getData() {
10+
return data;
11+
}
12+
public void setData(Object data) {
13+
this.data = data;
14+
}
15+
public MyBinaryTreeNode getLeft() {
16+
return left;
17+
}
18+
public void setLeft(MyBinaryTreeNode left) {
19+
this.left = left;
20+
}
21+
public MyBinaryTreeNode getRight() {
22+
return right;
23+
}
24+
public void setRight(MyBinaryTreeNode right) {
25+
this.right = right;
26+
}
27+
28+
public MyBinaryTreeNode insert(Object o){
29+
return null;
30+
}
31+
32+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package basic;
2+
3+
public interface MyIterator {
4+
public boolean hasNext();
5+
public Object next();
6+
7+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package basic;
2+
3+
public class MyLinkedList implements MyList {
4+
5+
private Node head;
6+
7+
public void add(Object o){
8+
9+
}
10+
public void add(int index , Object o){
11+
12+
}
13+
public Object get(int index){
14+
return null;
15+
}
16+
public Object remove(int index){
17+
return null;
18+
}
19+
20+
public int size(){
21+
return -1;
22+
}
23+
24+
public void addFirst(Object o){
25+
26+
}
27+
public void addLast(Object o){
28+
29+
}
30+
public Object removeFirst(){
31+
return null;
32+
}
33+
public Object removeLast(){
34+
return null;
35+
}
36+
public MyIterator iterator(){
37+
return null;
38+
}
39+
40+
41+
private static class Node{
42+
Object data;
43+
Node next;
44+
45+
}
46+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package basic;
2+
3+
public interface MyList {
4+
public void add(Object o);
5+
public void add(int index, Object o);
6+
public Object get(int index);
7+
public Object remove(int index);
8+
public int size();
9+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package basic;
2+
3+
public class MyQueue {
4+
5+
public void enQueue(Object o){
6+
}
7+
8+
public Object deQueue(){
9+
return null;
10+
}
11+
12+
public boolean isEmpty(){
13+
return false;
14+
}
15+
16+
public int size(){
17+
return -1;
18+
}
19+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package basic;
2+
3+
public class MyStack {
4+
private MyArrayList elementData = new MyArrayList();
5+
6+
public void push(Object o){
7+
}
8+
9+
public Object pop(){
10+
return null;
11+
}
12+
13+
public Object peek(){
14+
return null;
15+
}
16+
public boolean isEmpty(){
17+
return false;
18+
}
19+
public int size(){
20+
return -1;
21+
}
22+
}

group08/121027265/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 是标题
2+
* aaa
3+
* bbb

group08/1226637491/haha.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
heiheihei~~

group08/125980622/125980622.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Hello~Coding2017')

group08/1277959541/1277959541

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

group08/1287324781/1287324781

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

group08/1425809544/1425809544.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
测试

group08/1509102580/zzk.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
I am zzk!

group08/283677872/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
283677872

group08/286060098/286060098.md

Whitespace-only changes.

group08/406166841/406166841.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
406166841

group08/529757467/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

group08/529757467/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

group08/529757467/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>529757467</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

group08/619057560/CHHSAlex.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

group08/648354678/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 测试上传文件到git
2+
## 第一次上传以作学习
3+
## QQ:648354678
4+
### 希望跟大家共同学习进步

group08/649859235/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

group08/729770920/729770920.md

Whitespace-only changes.

group08/769638826/769638826.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
###自我介绍
2+

group08/782476895/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

group08/782476895/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

group08/782476895/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>782476895learning</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

group08/782476895/782476895.txt

Whitespace-only changes.

group08/875325254/875325254.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)