data structures using function function function function when calls ba is pushed on top of the system stack when the execution of is completethe system control will remove from the stack and continue with its execution when calls dc is pushed on top of the system stack when the execution of is completethe system control will remove from the stack and continue with its execution when calls cb is pushed on top of the system stack when the execution of is completethe system control will remove from the stack and continue with its execution function function when calls ed is pushed on top of the system stack when the execution of is completethe system control will remove from the stack and continue with its execution function function function function figure system stack in the case of function calls function function function when has executedd will be removed for execution function function function when has executedb will be removed for execution function when has executedc will be removed for execution function when has executeda will be removed for execution function function in order to keep track of the returning point of each active functiona special stack called system stack or call stack is used whenever function calls another functionthe calling function is pushed onto the top of the stack this is because after the called function gets executedthe control is passed back to the calling function look at fig which shows this concept now when function is executedfunction will be removed from the top of the stack and executed once function gets completely executedfunction will be removed from the stack for execution the whole procedure will be repeated until all the functions get executed let us look at the stack after each function is executed this is shown in fig the system stack ensures proper execution order of functions thereforestacks are frequently used in situations where the order of processing is very importantespecially when the processing needs to be postponed until other conditions are fulfilled stacks can be implemented using either arrays or linked lists in the following sectionswe will discuss both array and linked list implementation of stacks array representation of stacks in the computer' memorystacks can be represented as linear array every stack has variable called top associated with itwhich is used to store the address of the topmost element of the stack it is this position where the element will be added to or deleted from there is another variable called maxwhich is used to store the maximum number of elements that the stack can hold if top nullthen it indicates that the stack is empty and if top max- then the stack is full (you must be wondering why we have written max- it is because array indices start from look at fig figure system stack when called function returns to the calling function ab abc abcd abcde top figure stack the stack in fig shows that top so insertions and deletions will be done at this position in the above stackfive more elements can still be stored