Skip to content

Commit 5d32307

Browse files
one
1 parent 673c232 commit 5d32307

File tree

6 files changed

+96
-0
lines changed

6 files changed

+96
-0
lines changed

group05/1026626960/.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>

group05/1026626960/.gitignore

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

group05/1026626960/.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>1026626960Coding</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>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package cn.study1;
2+
3+
public class myIterator {
4+
//
5+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package cn.study1;
2+
3+
public class myQueue<T> {
4+
private class Node{
5+
T t;
6+
Node next;
7+
}
8+
private Node first;
9+
private Node last;
10+
private int N;
11+
public boolean isEmpty(){
12+
return N==0;
13+
}
14+
public int size(){
15+
return N;
16+
}
17+
public void enqueue(T t){
18+
Node oldlast = last;
19+
last = new Node();
20+
last.t = t;
21+
last.next = null;
22+
if(isEmpty()){
23+
first = last;
24+
}else{
25+
oldlast.next = last;
26+
}
27+
N++;
28+
}
29+
public T dequeue(){
30+
T t = first.t;
31+
first = first.next;
32+
if(isEmpty()){
33+
last = null;
34+
}
35+
N--;
36+
return t;
37+
}
38+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package cn.study1;
2+
3+
public class myStack<T> {
4+
private class Node{
5+
T t;
6+
Node next;
7+
}
8+
private Node first;
9+
private int N;
10+
public boolean isEmpty(){
11+
return N==0;
12+
}
13+
public int size(){
14+
return N;
15+
}
16+
public void push(T t){
17+
Node oldfirst = first;
18+
first = new Node();
19+
first.t = t;
20+
first.next = oldfirst;
21+
N++;
22+
}
23+
public T pop(){
24+
T t = first.t;
25+
first = first.next;
26+
N--;
27+
return t;
28+
}
29+
}

0 commit comments

Comments
 (0)