File tree Expand file tree Collapse file tree 5 files changed +49
-2
lines changed
org.eclipse.core.resources
.projects/Chapter_10_of_Algorithm/org.eclipse.jdt.core Expand file tree Collapse file tree 5 files changed +49
-2
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 11INDEX VERSION 1.126+/home/liyafei/test/IntroductionToAlgorithm/.metadata/.plugins/org.eclipse.jdt.core
222307328643.index
3+ 3938652823.index
342259717368.index
4- 3390519334.index
553542660237.index
6- 3938652823.index
76989528713.index
871259291233.index
982598035366.index
Original file line number Diff line number Diff 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 (){
You can’t perform that action at this time.
0 commit comments