Skip to content

Commit

Permalink
Merge pull request #4 from wangzhengliang/master
Browse files Browse the repository at this point in the history
one
  • Loading branch information
zhanglifeng authored Feb 25, 2017
2 parents 4a7495c + 5d32307 commit 2ac4403
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
6 changes: 6 additions & 0 deletions group05/1026626960/.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>
1 change: 1 addition & 0 deletions group05/1026626960/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions group05/1026626960/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>1026626960Coding</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>
5 changes: 5 additions & 0 deletions group05/1026626960/src/cn/study1/myIterator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package cn.study1;

public class myIterator {
//
}
38 changes: 38 additions & 0 deletions group05/1026626960/src/cn/study1/myQueue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package cn.study1;

public class myQueue<T> {
private class Node{
T t;
Node next;
}
private Node first;
private Node last;
private int N;
public boolean isEmpty(){
return N==0;
}
public int size(){
return N;
}
public void enqueue(T t){
Node oldlast = last;
last = new Node();
last.t = t;
last.next = null;
if(isEmpty()){
first = last;
}else{
oldlast.next = last;
}
N++;
}
public T dequeue(){
T t = first.t;
first = first.next;
if(isEmpty()){
last = null;
}
N--;
return t;
}
}
29 changes: 29 additions & 0 deletions group05/1026626960/src/cn/study1/myStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cn.study1;

public class myStack<T> {
private class Node{
T t;
Node next;
}
private Node first;
private int N;
public boolean isEmpty(){
return N==0;
}
public int size(){
return N;
}
public void push(T t){
Node oldfirst = first;
first = new Node();
first.t = t;
first.next = oldfirst;
N++;
}
public T pop(){
T t = first.t;
first = first.next;
N--;
return t;
}
}

0 comments on commit 2ac4403

Please sign in to comment.