September 14, 2023 in Data Structure
The various operations that are performed on the stack are CREATE(S) – Creates S as an empty stack. PUSH(S,X) – Adds the element X to the top of the stack. POP(S) – Deletes the top most elements from the stack. TOP(S) – returns the value of top element from the stack. ISEMTPTY(S) – returns true […]
September 14, 2023 in Data Structure
A Stack is an ordered list in which all insertions (Push operation) and deletion (Pop operation) are made at one end, called the top. The topmost element is pointed by top. The top is initialized to -1 when the stack is created that is when the stack is empty. In a stack S = (a1,an), […]
September 14, 2023 in Data Structure
➢ The linked list structure which can be represented using arrays is called static linked list.➢ It is easy to implement, hence for creation of small databases, it is useful➢ The searching of any record is efficient, hence the applications in which the record need to be searched quickly, the static linked list are used.
September 14, 2023 in Data Structure
➢ Change: the implementation of the ADT can be changed without making changes in theclient program that uses the ADT.➢ Understandability: ADT specifies what is to be done and does not specify theimplementation details. Hence code becomes easy to understand due to ADT.➢ Reusability: the ADT can be reused by some program in future.
September 14, 2023 in Data Structure
The header node is the very first node of the linked list. Sometimes a dummy value such – 999 is stored in the data field of header node. This node is useful for getting the starting address of the linked list.
September 14, 2023 in Data Structure
The linked list makes use of the dynamic memory allocation. Hence the user can allocate or de allocate the memory as per his requirements. On the other hand, the array makes use of the static memory location. Hence there are chances of wastage of the memory or shortage of memory for allocation.