Skip to content

Commit 2179193

Browse files
committed
修改了打印输出语句
1 parent 3866708 commit 2179193

File tree

5 files changed

+49
-2
lines changed

5 files changed

+49
-2
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package class1;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
public class StackAndQueue {
7+
8+
static List<Integer> list=new ArrayList<Integer>();
9+
10+
public static void main(String[] args) {
11+
List<Integer> list=Inital();
12+
boolean b=stackEmpty(list);
13+
System.out.println(b);
14+
list=Push(list,9);
15+
System.out.println(list);
16+
list=remove(list,9);
17+
System.out.println(list);
18+
}
19+
public StackAndQueue(List< Integer> list){
20+
this.list=list;
21+
22+
}
23+
public static List<Integer> Inital(){
24+
list.add(3);
25+
list.add(5);
26+
list.add(9);
27+
return list;
28+
}
29+
public static List Push(List list,int a){
30+
list.add(a);
31+
return list;
32+
}
33+
public static List remove(List list,int a){
34+
list.remove(list.size()-1);
35+
return list;
36+
}
37+
public static boolean stackEmpty(List< Integer> list){
38+
List list1=new ArrayList<>();
39+
System.out.println(list);
40+
System.out.println(list.hashCode());
41+
System.out.println(list1.hashCode());
42+
if (list==null)
43+
return true;
44+
else
45+
return false;
46+
}
47+
}

.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
INDEX VERSION 1.126+/home/liyafei/test/IntroductionToAlgorithm/.metadata/.plugins/org.eclipse.jdt.core
22
2307328643.index
3+
3938652823.index
34
2259717368.index
4-
3390519334.index
55
3542660237.index
6-
3938652823.index
76
989528713.index
87
1259291233.index
98
2598035366.index
64 Bytes
Binary file not shown.

Chapter_10_of_Algorithm/src/class1/StackAndQueue.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public static void main(String[] args) {
1818
}
1919
public StackAndQueue(List< Integer> list){
2020
this.list=list;
21+
System.out.println("hello github");
2122

2223
}
2324
public static List<Integer> Inital(){

0 commit comments

Comments
 (0)