Category: Data Structure
-
What are the various Operations performed on the Stack?
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…
-
Define Stack
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),…
-
What is static linked list? State any two applications of it.
➢ 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.
-
What is the advantage of an ADT?
➢ 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.
-
What is the basic purpose of header of the linked list?
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.
-
What is the circular linked list?
The circular linked list is a kind of linked list in which the last node is connected to the first node or head node of the linked list.
-
What is the advantage of linked list over arrays?
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.
-
Why is the linked list used for polynomial arithmetic?
We can have separate coefficient and exponent fields for representing each term of polynomial. Hence there is no limit for exponent. We can have any number as an exponent.
