-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStack.java
More file actions
21 lines (17 loc) · 744 Bytes
/
Stack.java
File metadata and controls
21 lines (17 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public interface Stack<T> {
public void clear(); //清空栈
/** Push an element onto the top of the stack.
@param it The element being pushed onto the stack. */
public void push(T it); //入栈
/** Remove and return the element at the top of the stack.
@return The element at the top of the stack. */
public T pop(); //弹栈
/** @return A copy of the top element. */
public T topValue(); //访问栈顶
/** @return The number of elements in the stack. */
public int length();
/** @return true if the stack is empty; otherwise false. */
public boolean isEmpty();
/** @return true if the stack is full; otherwise false. */
public boolean isFull();
}