-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathApp.java
More file actions
37 lines (32 loc) · 869 Bytes
/
App.java
File metadata and controls
37 lines (32 loc) · 869 Bytes
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
30
31
32
33
34
35
36
37
package com.jamal.arrayStack;
/**
* @author xiaoxiang
* @title: App
* @projectName arrayStack
* @description: TODO
* @date 2019/8/2215:11
*/
public class App {
public static void main(String[] args) {
// arrayStackTest();
linkStackTest();
}
public static void arrayStackTest(){
ArrayStack arrayStack = new ArrayStack(10);
for (int i = 0;i<20;i++) {
System.out.println(arrayStack.push("张三"+i));
}
for (int i = 0;i<20;i++) {
System.out.println(arrayStack.pop());
}
}
public static void linkStackTest(){
LinkStack linkStack = new LinkStack();
for (int i = 0;i<20;i++) {
System.out.println(linkStack.push("张三"+i));
}
for (int i = 0;i<20;i++) {
System.out.println(linkStack.pop());
}
}
}