commit
This commit is contained in:
parent
9becc62ff7
commit
556869ebb8
3 changed files with 63 additions and 9 deletions
|
@ -13,6 +13,10 @@ public class Stack <T> {
|
|||
array = new Vector<T>();
|
||||
}
|
||||
|
||||
public Stack(Vector<T> array) {
|
||||
array = array;
|
||||
}
|
||||
|
||||
// Methods
|
||||
|
||||
public void push(T x) {
|
||||
|
@ -28,4 +32,8 @@ public class Stack <T> {
|
|||
public int size() {
|
||||
return this.array.size();
|
||||
}
|
||||
|
||||
public Stack copy() {
|
||||
return new Stack(new Vector<T>(this.array));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue