Skip to content

Commit 3ce3394

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 8a501a5 + d79fb4a commit 3ce3394

File tree

784 files changed

+37444
-3897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

784 files changed

+37444
-3897
lines changed

.gitignore

-29
Original file line numberDiff line numberDiff line change
@@ -1,30 +1 @@
1-
*.class
2-
# Mobile Tools for Java (J2ME)
3-
.mtj.tmp/
4-
5-
# Package Files #
6-
*.jar
7-
*.war
8-
*.ear
9-
target
10-
11-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12-
hs_err_pid*
13-
14-
#ide config
15-
.metadata
16-
.recommenders
17-
.idea/
18-
19-
20-
21-
#macOS
22-
.DS_Store
23-
24-
25-
*.iml
26-
rebel.*
27-
.rebel.*
28-
29-
target
301

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 2017编程提高社群
2+
3+
2017编程提高社群代码仓库所在地

group01/1664823950/.project

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3+
<<<<<<< HEAD:group01/1664823950/.project
34
<name>1664823950</name>
5+
=======
6+
<name>1264835468</name>
7+
>>>>>>> master:group17/1264835468/.project
48
<comment></comment>
59
<projects>
610
</projects>

group01/group01.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

group02/group02.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

group03/group03.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

group04/group04.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

group05/group05.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import java.util.*;
2+
3+
/**
4+
* @author CCD
5+
*
6+
*/
7+
public class MyArrayList {
8+
9+
private Object[] elementData = new Object[100];
10+
private int size = 100 ;
11+
12+
public void add(Object o){
13+
elementData[size++] = o;
14+
}
15+
public void add(int index, Object o){
16+
if(index > size || index < 0)
17+
throw new IndexOutOfBoundsException("index "+ index +"is biger than size" + size+
18+
"index is less than 0");
19+
System.arraycopy(elementData, index, elementData, index+1, size-index);
20+
elementData[index] = o;
21+
size++;
22+
}
23+
24+
public Object get(int index){
25+
if(index > size || index < 0)
26+
throw new IndexOutOfBoundsException("index "+ index +"is biger than size" + size+
27+
"index is less than 0");
28+
return elementData[index];
29+
}
30+
31+
public Object remove(int index){
32+
if(index > size || index < 0)
33+
throw new IndexOutOfBoundsException("index "+ index +"is biger than size" + size+
34+
"index is less than 0");
35+
Object E = elementData[index];
36+
System.arraycopy(elementData, index+1, elementData, index,
37+
size - index - 1);
38+
elementData[--size] = null;
39+
return E;
40+
}
41+
42+
public int size(){
43+
return size;
44+
}
45+
46+
public Iterator iterator(){
47+
return null;
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
import java.util.*;
2+
3+
public class MyLinkedList implements List {
4+
5+
private Node first;
6+
private Node last;
7+
private int size = 0 ;
8+
public void Myadd(Object o){
9+
final Node l = last;
10+
final Node newNode = new Node(l,o,null);
11+
last = newNode;
12+
if(l == null)
13+
first = newNode;
14+
else
15+
l.next = newNode;
16+
size++;
17+
}
18+
public void Myadd(int index , Object o){
19+
checkPosition(index);
20+
if(index == size){
21+
Myadd(o);
22+
}
23+
else{
24+
final Node PreNode =GetNodeByIndex(index).prev;
25+
final Node newNode = new Node(PreNode,o,GetNodeByIndex(index));
26+
PreNode.next =newNode;
27+
if(PreNode == null)
28+
first = newNode; //ΪʲôҪ¸¶¸øÊ×Ö¸Õ룿
29+
else
30+
PreNode.next = newNode;
31+
size++;
32+
}
33+
}
34+
public Object get(int index){
35+
checkPosition(index);
36+
return GetNodeByIndex(index);
37+
}
38+
public void remove(int index){
39+
Node node = GetNodeByIndex(index);
40+
node.prev.next = node.next;
41+
node.next.prev = node.prev;
42+
node = null;
43+
size--;
44+
}
45+
46+
public int size(){
47+
return size;
48+
}
49+
50+
public void addFirst(Object o){
51+
final Node FirstNode= first;
52+
final Node newNode = new Node(null,o,first);
53+
first = newNode;
54+
if(FirstNode == null)
55+
last = newNode;
56+
else
57+
first.prev = newNode;
58+
size++;
59+
60+
}
61+
public void addLast(Object o){
62+
final Node LastNode = last;
63+
final Node newNode = new Node(last,o,null);
64+
last = newNode;
65+
if(last == null)
66+
first = newNode;
67+
else
68+
last.next = newNode;
69+
size++;
70+
}
71+
public void removeFirst(){
72+
final Node f = first;
73+
if(f == null)
74+
throw new NoSuchElementException();
75+
first = f.next;
76+
first = null;
77+
size--;
78+
}
79+
public void removeLast(){
80+
final Node f = last;
81+
if(f == null)
82+
throw new NoSuchElementException();
83+
last = last.prev;
84+
last = null;
85+
size--;
86+
}
87+
public Iterator iterator(){
88+
return null;
89+
}
90+
91+
92+
private static class Node{
93+
Object item;
94+
Node next;
95+
Node prev;
96+
Node (Node prev,Object element ,Node next){
97+
this.item = element;
98+
this.next = next;
99+
this.prev = prev;
100+
}
101+
}
102+
103+
private Node GetNodeByIndex(int index){
104+
if(index > size/2)
105+
{
106+
Node Temp = first;
107+
for(int i = 0; i< index;i++)
108+
Temp = Temp.next; //
109+
return Temp;
110+
}
111+
else
112+
{
113+
Node Temp = last;
114+
for(int i = size-1; i> index; i--)
115+
Temp = Temp.prev;
116+
return Temp;
117+
}
118+
}
119+
120+
private void checkPosition(int index){
121+
if(index < 0 || index > size)
122+
throw new IndexOutOfBoundsException("index:"+ index+"is llegal");
123+
}
124+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
/**
3+
* @author CCD
4+
*
5+
*/
6+
7+
import java.util.*;
8+
9+
public class MyQueue {
10+
11+
private static final int DEFAULT_SIZE = 10;
12+
13+
private Object[] elementData;
14+
private int head;
15+
private int tail;
16+
public MyQueue(){
17+
this(DEFAULT_SIZE);
18+
}
19+
public MyQueue(int size){
20+
this.elementData = new Object[size];
21+
this.head = 0;
22+
this.tail = 0;
23+
}
24+
25+
public void enQueue(Object o){
26+
if((tail+1)%elementData.length == head){
27+
}
28+
else{
29+
elementData[tail] = o;
30+
tail = (tail+1)%elementData.length;
31+
}
32+
}
33+
34+
public Object deQueue(){
35+
if(head == tail){
36+
return null;
37+
}
38+
else{
39+
Object o = elementData[head];
40+
head = (head+1)% elementData.length;
41+
return o ;
42+
}
43+
}
44+
45+
public boolean isEmpty(){
46+
return head == tail ;
47+
}
48+
49+
public int size(){
50+
return (tail-head)&(elementData.length -1);
51+
}
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import java.util.*;
2+
3+
/**
4+
*
5+
*/
6+
7+
/**
8+
* @author CCD
9+
*
10+
*/
11+
public class MyStack {
12+
13+
private ArrayList elementData = new ArrayList();
14+
private Object[] Myelement = elementData.toArray();
15+
private int Length = elementData.size();
16+
17+
public void push(Object E){
18+
Myelement[++Length] = E ;
19+
}
20+
21+
public Object pop(){
22+
int NowLength = size()-1;
23+
Object obj = peek();
24+
Length--;
25+
Myelement[Length] = null ;
26+
return obj;
27+
}
28+
29+
public Object peek(){
30+
int NowLength = size();
31+
if(NowLength == 0)
32+
throw new EmptyStackException();
33+
NowLength -= 1 ;
34+
if(NowLength >= Length )
35+
throw new ArrayIndexOutOfBoundsException(NowLength + " >= " + Length);
36+
return Myelement[NowLength];
37+
38+
}
39+
public boolean isEmpty(){
40+
return size() == 0;
41+
}
42+
public int size(){
43+
return Length;
44+
}
45+
}
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/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>JavaLearning</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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.6
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.6

0 commit comments

Comments
 (0)