00:01
Hello student, here i have to write the pseudocode.
00:04
The first problem is use the operation pushpop peek and empty to construct an operation that sets i to the bottom element of the stack leaving the stack unchanged.
00:15
So here we can use an auxiliary stack because we have not to change the element.
00:21
So procedure set underscore bottom underscore element to i it's a name of the procedure.
00:27
I am sending the argument stack and i.
00:31
Auxiliary stack i have taken and it's empty at the starting empty underscore stack.
00:37
While not stack empty we are using the while loop and we are checking the stack is empty or not.
00:43
If the stack is not empty do the process which execute those statement which are written inside the while loop.
00:50
Element equal to stack dot pop.
00:53
So we have to pop out the element from the stack and we have to push this element into the auxiliary stack.
01:01
So we are taking the element from the existing stack.
01:08
This one this is the existing stack and we are now pushing this element into the auxiliary stack.
01:21
So this is the auxiliary stack.
01:23
So here we are taking the element and we are pushing into it.
01:27
Here pop operation and here push operation.
01:32
So this is the work.
01:35
So here i equal to auxiliary underscore stack dot pop.
01:39
Now we are taking out the element from the auxiliary stack and in this way procedure ends.
01:47
So first we are pushing the element from the given stack and now we are taking the element from the auxiliary stack because here we have to use the operation push pop peek and empty to construct an operation that sets i to the bottom element of the stack...