when data is pushed onto stack to use stack efficientlywe need to check the status of stack as well for the same purposethe following functionality is added to stacks peek(get the top data element of the stackwithout removing it isfull(check if stack is full isempty(check if stack is empty at all timeswe maintain pointer to the last pushed data on the stack as this pointer always represents the top of the stackhence named top the top pointer provides top value of the stack without actually removing it first we should learn about procedures to support stack functions peek(algorithm of peek(function begin procedure peek return stack[topend procedure implementation of peek(function in programming language example int peek(return stack[top]isfull(algorithm of isfull(function begin procedure isfull if top equals to maxsize return true else return false endif end procedure implementation of isfull(function in programming language example bool isfull(if(top =maxsizereturn trueelse return false