To insert an element at given position in array: Insert(stack s1, stack s2, int value, int pos) //Inserts a value into the array at specified position. //Assume s1 is a stack which holds the values, and s2 is an empty stack. while(!s1.empty()) //Till the stack is empty. s2.push(s1.pop()) //Pop element from s1, and push it in s2. //By now, all elements are placed in reverse order from s1 to s2. for i = 1 to pos - 1 //Till the pos-1 s1.push(s2.pop()) //Remove elements from s2, and push them to s1. s1.push(value) //Now push your element in specified position pos. while(!s2.empty()) //Push all the remaining elements in s2 to s1. s1.push(s2.pop()) To delete an element at given position in array: Delete(stack s1, stack s2, int pos) //Deletes a value into the array at specified position. //Assume s1 is a stack which holds the values, and s2 is an empty stack. while(!s1.empty()) //Till the stack is empty. s2.push(s1.pop()) //Pop element from s1, and push it in s2. //By now, all elements are placed in reverse order from s1 to s2. for i = 1 to pos - 1 //Till the pos-1 s1.push(s2.pop()) //Remove elements from s2, and push them to s1. s1.pop(value) //Now pop your element in specified position pos. while(!s2.empty()) //Push all the remaining elements in s2 to s1. s1.push(s2.pop()) To delete a given element in array: DeleteVal(stack s1, stack s2, int value) //Deletes a value from the array. //Assume s1 is a stack which holds the values, and s2 is an empty stack. while(!s1.empty()) //Till the stack is empty. s2.push(s1.pop()) //Pop element from s1, and push it in s2. //By now, all elements are placed in reverse order from s1 to s2. ele = s2.peek(); while(ele != value || !s2.empty()) //Till you found the element to be deleted. s1.push(s2.pop()) //Remove elements from s2, and push them to s1. ele = s2.peek() s2.pop(value) //If element is found, delete it. while(!s2.empty()) //Push all the remaining elements in s2 to s1. s1.push(s2.pop()) If you have any queries with this, just get back to me. Solution To insert an element at given position in array: Insert(stack s1, stack s2, int value, int pos) //Inserts a value into the array at specified position. //Assume s1 is a stack which holds the values, and s2 is an empty stack. while(!s1.empty()) //Till the stack is empty. s2.push(s1.pop()) //Pop element from s1, and push it in s2. //By now, all elements are placed in reverse order from s1 to s2. for i = 1 to pos - 1 //Till the pos-1 s1.push(s2.pop()) //Remove elements from s2, and push them to s1. s1.push(value) //Now push your element in specified position pos. while(!s2.empty()) //Push all the remaining elements in s2 to s1. s1.push(s2.pop()) To delete an element at given position in array: Delete(stack s1, stack s2, int pos) //Deletes a value into the array at specified position. //Assume s1 is a stack which holds the values, and s2 is an empty stack. while(!s1.empty()) //Till the stack is empty. s2.push(s1.pop()) //Pop element from s1, and push it in s2. //By .