1.

Queue implemented using 2 Stacks: void insert(int x){push(S1,x);}int delete(){int x;if(isEmpty($2)){if(isEmpty(51))printf("Empty Queue");elsewhile(!isEmpty($i)){x=pop(51);pusli($2,x);return pop (52);If m_insert and n(

Answer»

tion:Queue implemented using 2 Stacks:void insert(int X){push(S1,x);}int delete(){int x;if(isEmpty($2)){if(isEmpty(51))printf("Empty Queue");elsewhile(!isEmpty($i)){x=pop(51);pusli($2,x);return pop (52);If m_insert and n(<=m) delete operation are CARRIED out. If p and q are number of push and popperformed RESPECTIVELY, which among the following is TRUE for all m and n?



Discussion

No Comment Found

Related InterviewSolutions