Skip to content

Commit

Permalink
Merge pull request #1 from luoziyihao/master
Browse files Browse the repository at this point in the history
pull request for code of homework 26 Feb
  • Loading branch information
williamgx8 authored Feb 27, 2017
2 parents f83c004 + 6daa87d commit dcc74d5
Show file tree
Hide file tree
Showing 718 changed files with 34,965 additions and 1,313 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@
*.jar
*.war
*.ear
target

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

#ide config
.metadata
.recommenders


#macOS
.DS_Store

.idea/
*.iml
rebel.*
.rebel.*

target
2 changes: 1 addition & 1 deletion group01/group01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@


2 changes: 1 addition & 1 deletion group02/group02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@


2 changes: 1 addition & 1 deletion group03/group03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@


2 changes: 1 addition & 1 deletion group04/group04.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@


2 changes: 1 addition & 1 deletion group05/group05.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@


2 changes: 1 addition & 1 deletion group06/group06.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@


11 changes: 11 additions & 0 deletions group07/1046545622/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
11 changes: 11 additions & 0 deletions group07/1058267830/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
11 changes: 11 additions & 0 deletions group07/1070440331/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
11 changes: 11 additions & 0 deletions group07/1280157271/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
11 changes: 11 additions & 0 deletions group07/1448276993/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
11 changes: 11 additions & 0 deletions group07/1519504320/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
11 changes: 11 additions & 0 deletions group07/1520332119/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
6 changes: 6 additions & 0 deletions group07/1536161030/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?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="output" path="bin"/>
</classpath>
22 changes: 22 additions & 0 deletions group07/1536161030/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
17 changes: 17 additions & 0 deletions group07/1536161030/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>homework</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>
2 changes: 2 additions & 0 deletions group07/1536161030/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
12 changes: 12 additions & 0 deletions group07/1536161030/CPU,内存,硬盘,指令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
������ڲ���Ҫ���������CPU���ڴ棬Ӳ�̣�ָ�
CPU��Ҳ�д��������˿�����˼�������Կ�CPU���㡣CPU��Ҫ�������Ϳ��ƵIJ��֣�����˼�壬���ǿ��Ƶ�Ԫ�����㵥Ԫ�����֣������˵Ĵ��Խ��м��������һ����
�����Եļ����������һ��ģ����������ÿ�����ܵ�Ԫ���Ƿֹ���ȷ�ġ����п��Ƶ�Ԫ���ݳ���ͨ��ָ�����������㵥Ԫ����������ó������Ȼ����ƴ洢��Ԫ���洢�м�Ľ����
�ڴ��Ǵ洢CPU��Ҫ���������ϣ���Ҫ�����У�����ϵͳ�е���ʱ���ݣ������Ӳ�̶�ȡ�����ݣ��ṩ��CPUʹ�á�
Ӳ���Ǹ���洢������Ҫ���ô洢�����ݣ��������ǵij�������ݣ��ŵ��Ƿdz��̶���������׼ȷ���������Դ洢����Ϣ��������ʱ���������
�ڴ��ȡ���ݵ��ٶȱ�Ӳ�̵Ĵ�ȡ�ٶȿ���10���� ��ijЩ��������ܻ����
CPU���ٶȱ��ڴ治֪Ҫ����ٱ��������ǰѳ����Ӳ�̷ŵ��ڴ��Ժ�CPU��ֱ�����ڴ����г���������CPUֱ����Ӳ�����г����Ҫ��ܶࡣ
�����ڴ�����һ����CPU���й��죬��Ӳ�����ݴ�ȡ̫�������⡣ ��������ǵĵ��Ե������ٶȡ�
���������г����ʱ��CPU���Ƚ��ܵ����ǵ����֮��CPU�Ǹ���Ӳ�̣���Ҫ������洢�ij���A����ѳ���A�͵��ڴ�ȥ��CPU���ڴ�˵������Ӳ�̰ѳ���A�͵����������ˣ��㱣��һ�¡� �ȳ���A���������͵��ڴ�֮��CPU�Ϳ�ʼִ�г���A����CPU������㣬���ȡ������δ洢���ݣ�������ζ������������й�ͨ�������Ҫָ���ˡ�
ָ��Ҳ���ǻ������Ե�һ������䣬�൱��CPU���ڴ棬Ӳ��֮������ԡ�����ָ�Ӽ�������������������������ݵ����㣬�߼����㣬���ݴ��ͣ�����Ŀ��ƣ��������ָ��ȡ�


11 changes: 11 additions & 0 deletions group07/1536161030/git命令.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
��װgit gui��������git bash����
1.��¡
git clone [email protected]:leijing1992/coding2017.git
2.�����޸ĵ��ļ�
git add -A
3.�ύ���ݴ���
git commit -m "�ύ***����"
4.����master
git pull origin master
5.�ύ��master
git push origin master
95 changes: 95 additions & 0 deletions group07/1536161030/src/com/coding/basic/ArrayList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package com.coding.basic;

public class ArrayList implements List{

private int size = 0;

private Object[] elementData;

public ArrayList(int size) {
this.elementData = new Object[size];
}

public ArrayList() {
this.elementData = new Object[10];
}

public void add(Object o) {
if(isFull())
resize();
elementData[size++] = o;
}

public void add(int index, Object o) {
rangeCheckForAdd(index);
System.arraycopy(elementData, index, elementData, index + 1, size - index);
elementData[index] = o;
size++;
}

public Object get(int index) {
rangeCheckForAdd(index);
return elementData[index];
}

public Object remove(int index) {
rangeCheckForAdd(index);
Object o = elementData[index];
System.arraycopy(elementData, index + 1, elementData, index, size - index);
elementData[--size] = null;
return o;
}

public int size() {
return elementData.length;
}

public com.coding.basic.Iterator iterator() {
return new Itr();
}

private class Itr implements com.coding.basic.Iterator {
int cursor;

@Override
public boolean hasNext() {
return cursor != size;
}

@Override
public Object next() {
int i = cursor;
if (i < elementData.length) {
cursor = i + 1;
return elementData[i];
}
return null;
}
}

//檢查下表越界
public void rangeCheckForAdd(int index) {
if (index < 0 || index > size)
throw new IndexOutOfBoundsException("下标越界");
}

//数组是否满
public boolean isFull(){
return size == elementData.length;
}

//扩容
public void resize(){
Object[] newElementData = new Object[elementData.length * 2];
System.arraycopy(elementData, 0, newElementData, 0, size);
this.elementData = newElementData;
newElementData = null;
}

//
public boolean isEmpty() {
return size == 0;
}


}
75 changes: 75 additions & 0 deletions group07/1536161030/src/com/coding/basic/BinaryTreeNode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.coding.basic;

public class BinaryTreeNode <Object extends Comparable<Object>> {

private Object data;

private BinaryTreeNode left;

private BinaryTreeNode right;

public BinaryTreeNode(Object data){
this.data = data;
this.left=null;
this.right =null;
}

public BinaryTreeNode root;

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;
}
/*
* 二叉树 b 插入对象 o 父节点 pnode
* 若b为空树,插入节点作为根
* o 等于根节点 直接返回
* o 小于根节点 pnode = 左子树
* else pnode = 右子树
*
*/
public BinaryTreeNode insert(Object o) {
BinaryTreeNode current = root;

if(current == null){
return new BinaryTreeNode(o);
}
if (o.compareTo((Object) current.data)<0){
if(current.left !=null){
current = current.left;
}else{
current.left = new BinaryTreeNode(o);
return current;
}
}else if(o.compareTo((Object) current.data)==0){
return current;
}else{
if(current.right !=null){
current = current.right;
}else{
current.right = new BinaryTreeNode(o);
return current;
}
}
return current;
}
}
8 changes: 8 additions & 0 deletions group07/1536161030/src/com/coding/basic/Iterator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.coding.basic;

public interface Iterator {
boolean hasNext();

Object next();

}
Loading

0 comments on commit dcc74d5

Please sign in to comment.