Datasets:

ArXiv:
License:
File size: 778 Bytes
c574d3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package rd222dv_assign1.intCollection;

	import java.lang.IndexOutOfBoundsException;


	/* A simple interface describing an integer stack.

	   Updated with exceptions 2015-09-17. */

	public interface IntStack extends Iterable<Integer> {
		/* Add integer at top of stack. */
		public void push(int n);
		
		/* Returns and removes integer at top of stack  */
		public int pop() throws IndexOutOfBoundsException;
		
		/* Returns without removing integer at top of stack */
		public int peek() throws IndexOutOfBoundsException;
		
		/* Number of integers currently stored. */
		public int size();
		
		/* Returns true if collection is empty. */
		public boolean isEmpty();
		
		/* String of type "[ 7 56 -45 68 ... ]" */
		public String toString();
	}