the last node in the list contains null pointer to indicate that it is the end or tail of the list since the memory for node is dynamically allocated when it is added to the listthe total number of nodes that may be added to list is limited only by the amount of memory available figure shows linked list of seven nodes figure simple linked list note advantageeasier to insert or delete data elements disadvantageslow search operation and requires more memory space stacks stack is linear data structure in which insertion and deletion of elements are done at only one endwhich is known as the top of the stack stack is called last-infirst-out (lifostructure because the last element which is added to the stack is the first element which is deleted from the stack in the computer' memorystacks can be implemented using arrays or linked lists figure shows the array implementation of stack every stack has variable top associated with it top is used to store the address of the topmost element of the stack it is this position from where the element will be added or deleted there is another variable maxwhich is used to store the maximum number of elements that the stack can store if top nullthen it indicates that the stack is empty and if top max- then the stack is full ab abc abcd abcde top figure array representation of stack in fig top so insertions and deletions will be done at this position herethe stack can store maximum of elements where the indices range from - in the above stackfive more elements can still be stored stack supports three basic operationspushpopand peep the push operation adds an element to the top of the stack the pop operation removes the element from the top of the stack and the peep operation returns the value of the topmost element of the stack (without deleting ithoweverbefore inserting an element in the stackwe must check for overflow conditions an overflow occurs when we try to insert an element into stack that is already full similarlybefore deleting an element from the stackwe must check for underflow conditions an underflow condition occurs when we try to delete an element from stack that is already empty queues queue is first-infirst-out (fifodata structure in which the element that is inserted first is the first one to be taken out the elements in queue are added at one end called the rear and removed from the other end called the front like stacksqueues can be implemented by using either arrays or linked lists every queue has front and rear variables that point to the position from where deletions and insertions can be donerespectively consider the queue shown in fig