+2ComputerAnsvyv
+2ComputerAnsvyv
Ans.
1.Stack --- Push – Inserting a new item
2. Queue ---- Front ---- Removing an item
3. Array ---- Subscript ---- Elements are accessed by specifying its position
4. Linked list -------- Start ----- Contains the address of the first
13.Differentiate static and dynamic data structure. Give an example for each.
Ans.
In static data structures, memory is allocated before the execution of the program. Here, the
memory space will be fixed throughout the execution. Eg:- Arrays, Structures etc.
In dynamic data structures, the memory is allocated during the execution of program. Data
structures implemented using linked lists are dynamic in nature.
14. Write an algorithm to perform pop operation in a stack.
Start
If (TOP > - 1) Then
VAL = STACK [TOS]
TOP = TOP - 1
Else
Print “Stack Underflow”
End of If
Stop