forked from onlyliuxin/coding2017
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/onlyliuxin/coding2017
find missing folder
- Loading branch information
Showing
740 changed files
with
35,661 additions
and
3,884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 2017编程提高社群 | ||
|
||
2017编程提高社群代码仓库所在地 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
124
group06/1049564215/src/com/coding/basic/MyLinkedList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
11 changes: 11 additions & 0 deletions
11
group06/1259131938/JavaLearning/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.