Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int Search(int x){
- ArrayStack n = null;
- n=new ArrayStack(n.size());
- ArrayStack m=null;
- m=new ArrayStack(n.size());
- while(!n.isEmpty()){
- for(int i=0;i<n.size();i++){
- if(n.top()==x)
- return n.top();
- else{
- m.push(n.pop());
- }
- }
- }
- return -1;
- }
Add Comment
Please, Sign In to add comment