SHARE
TWEET

Untitled

a guest Jan 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static int Search(int x){
  2.         ArrayStack n = null;
  3.         n=new ArrayStack(n.size());
  4.         ArrayStack m=null;
  5.         m=new ArrayStack(n.size());
  6.         while(!n.isEmpty()){
  7.         for(int i=0;i<n.size();i++){
  8.             if(n.top()==x)
  9.                 return n.top();
  10.             else{
  11.                 m.push(n.pop());
  12.             }
  13.         }
  14.         }
  15.         return -1;
  16.        
  17.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top