Skip to content
Snippets Groups Projects
Commit fe7db8ae authored by SAIL Mohamed amine's avatar SAIL Mohamed amine
Browse files

exo1 et 2 finalisation

parent 57daf9ac
No related branches found
No related tags found
No related merge requests found
Pipeline #21405 failed
...@@ -9,14 +9,19 @@ public class Stack { ...@@ -9,14 +9,19 @@ public class Stack {
v.add(value); v.add(value);
} }
int peek(){ int peek(){
return v.get(v.); return v.get(v.size());
} }
int pop(){ int pop(){
this.pop();
return this.peek();
} }
int size(){ int size(){
return v.size(); return this.v.size();
}
boolean isEmpty(){
return this.v.isEmpty();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment