Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/onlyliuxin/coding2017
Browse files Browse the repository at this point in the history
find missing folder
  • Loading branch information
he committed Mar 1, 2017
2 parents 922b7d9 + feeae45 commit f7f0b93
Show file tree
Hide file tree
Showing 740 changed files with 35,661 additions and 3,884 deletions.
29 changes: 0 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.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
.idea/



#macOS
.DS_Store


*.iml
rebel.*
.rebel.*

target

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2017编程提高社群

2017编程提高社群代码仓库所在地
4 changes: 4 additions & 0 deletions group01/1664823950/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<<<<<<< HEAD:group01/1664823950/.project
<name>1664823950</name>
=======
<name>1264835468</name>
>>>>>>> master:group17/1264835468/.project
<comment></comment>
<projects>
</projects>
Expand Down
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 @@


49 changes: 49 additions & 0 deletions group06/1049564215/src/com/coding/basic/MyArrayList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import java.util.*;

/**
* @author CCD
*
*/
public class MyArrayList {

private Object[] elementData = new Object[100];
private int size = 100 ;

public void add(Object o){
elementData[size++] = o;
}
public void add(int index, Object o){
if(index > size || index < 0)
throw new IndexOutOfBoundsException("index "+ index +"is biger than size" + size+
"index is less than 0");
System.arraycopy(elementData, index, elementData, index+1, size-index);
elementData[index] = o;
size++;
}

public Object get(int index){
if(index > size || index < 0)
throw new IndexOutOfBoundsException("index "+ index +"is biger than size" + size+
"index is less than 0");
return elementData[index];
}

public Object remove(int index){
if(index > size || index < 0)
throw new IndexOutOfBoundsException("index "+ index +"is biger than size" + size+
"index is less than 0");
Object E = elementData[index];
System.arraycopy(elementData, index+1, elementData, index,
size - index - 1);
elementData[--size] = null;
return E;
}

public int size(){
return size;
}

public Iterator iterator(){
return null;
}
}
124 changes: 124 additions & 0 deletions group06/1049564215/src/com/coding/basic/MyLinkedList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import java.util.*;

public class MyLinkedList implements List {

private Node first;
private Node last;
private int size = 0 ;
public void Myadd(Object o){
final Node l = last;
final Node newNode = new Node(l,o,null);
last = newNode;
if(l == null)
first = newNode;
else
l.next = newNode;
size++;
}
public void Myadd(int index , Object o){
checkPosition(index);
if(index == size){
Myadd(o);
}
else{
final Node PreNode =GetNodeByIndex(index).prev;
final Node newNode = new Node(PreNode,o,GetNodeByIndex(index));
PreNode.next =newNode;
if(PreNode == null)
first = newNode; //ΪʲôҪ¸¶¸øÊ×Ö¸Õ룿
else
PreNode.next = newNode;
size++;
}
}
public Object get(int index){
checkPosition(index);
return GetNodeByIndex(index);
}
public void remove(int index){
Node node = GetNodeByIndex(index);
node.prev.next = node.next;
node.next.prev = node.prev;
node = null;
size--;
}

public int size(){
return size;
}

public void addFirst(Object o){
final Node FirstNode= first;
final Node newNode = new Node(null,o,first);
first = newNode;
if(FirstNode == null)
last = newNode;
else
first.prev = newNode;
size++;

}
public void addLast(Object o){
final Node LastNode = last;
final Node newNode = new Node(last,o,null);
last = newNode;
if(last == null)
first = newNode;
else
last.next = newNode;
size++;
}
public void removeFirst(){
final Node f = first;
if(f == null)
throw new NoSuchElementException();
first = f.next;
first = null;
size--;
}
public void removeLast(){
final Node f = last;
if(f == null)
throw new NoSuchElementException();
last = last.prev;
last = null;
size--;
}
public Iterator iterator(){
return null;
}


private static class Node{
Object item;
Node next;
Node prev;
Node (Node prev,Object element ,Node next){
this.item = element;
this.next = next;
this.prev = prev;
}
}

private Node GetNodeByIndex(int index){
if(index > size/2)
{
Node Temp = first;
for(int i = 0; i< index;i++)
Temp = Temp.next; //
return Temp;
}
else
{
Node Temp = last;
for(int i = size-1; i> index; i--)
Temp = Temp.prev;
return Temp;
}
}

private void checkPosition(int index){
if(index < 0 || index > size)
throw new IndexOutOfBoundsException("index:"+ index+"is llegal");
}
}
52 changes: 52 additions & 0 deletions group06/1049564215/src/com/coding/basic/MyQueue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

/**
* @author CCD
*
*/

import java.util.*;

public class MyQueue {

private static final int DEFAULT_SIZE = 10;

private Object[] elementData;
private int head;
private int tail;
public MyQueue(){
this(DEFAULT_SIZE);
}
public MyQueue(int size){
this.elementData = new Object[size];
this.head = 0;
this.tail = 0;
}

public void enQueue(Object o){
if((tail+1)%elementData.length == head){
}
else{
elementData[tail] = o;
tail = (tail+1)%elementData.length;
}
}

public Object deQueue(){
if(head == tail){
return null;
}
else{
Object o = elementData[head];
head = (head+1)% elementData.length;
return o ;
}
}

public boolean isEmpty(){
return head == tail ;
}

public int size(){
return (tail-head)&(elementData.length -1);
}
}
45 changes: 45 additions & 0 deletions group06/1049564215/src/com/coding/basic/MyStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import java.util.*;

/**
*
*/

/**
* @author CCD
*
*/
public class MyStack {

private ArrayList elementData = new ArrayList();
private Object[] Myelement = elementData.toArray();
private int Length = elementData.size();

public void push(Object E){
Myelement[++Length] = E ;
}

public Object pop(){
int NowLength = size()-1;
Object obj = peek();
Length--;
Myelement[Length] = null ;
return obj;
}

public Object peek(){
int NowLength = size();
if(NowLength == 0)
throw new EmptyStackException();
NowLength -= 1 ;
if(NowLength >= Length )
throw new ArrayIndexOutOfBoundsException(NowLength + " >= " + Length);
return Myelement[NowLength];

}
public boolean isEmpty(){
return size() == 0;
}
public int size(){
return Length;
}
}
6 changes: 6 additions & 0 deletions group06/1259131938/JavaLearning/.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/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions group06/1259131938/JavaLearning/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions group06/1259131938/JavaLearning/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>JavaLearning</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
Loading

0 comments on commit f7f0b93

Please sign in to comment.