Searching element in the stack
static void stack_search ( Stack < Integer > stack , int element ) { Integer pos = ( Integer ) stack . search ( element ) ; if ( pos == - 1 ) System . out . println ( " Element ▁ not ▁ found " ) ; else System . out . println ( " Element ▁ is ▁ found ▁ at ▁ position ▁ " + pos ) ; }