muje is program ka algorithm chaiye kya koi help kr sakta hai kis tarah likengey ...........?
class Push {
public static void main (String args[]){
int stck[ ] = new int[10];
int item[ ] = {111,22,33,44,55,66,77,88,99,11};
int tos = -1;
for(int i=0;i<=10;i++){
if(tos == 9)
System.out.println("Stack is full.");
else
stck[ ++tos ] = item[i];
System.out.println("--> "+ item[i]); }
}
}
Bookmarks