Professional Documents
Culture Documents
Operations:
Union
Intersection
Size
Complement
Find
Example:
Objects such as set, lists and graphs along their operations can be
Viewed as ADT’s
NODE
Data Link
General Form:
A1,A2,………….An
Where
n -> size of the list
Ai-1 -> precedes Ai for i>n
Ai+1 -> succeeds for i<n
Advantages:
Disadvantages:
Fields
TYPES
Head
10 20 30 Null
Advantages:
Disadvantages:
Head
10 20 30 Null
Fields:
Next Pointer:- Next pointer points to the address of the Next Node.
NODE
Previous Next
Pointer Field Data Field Pointer Field
Head
10 20 30 Null
10.Give the applications of linked list?
Polynomial ADT
Radix Sort
Bucket Sort
MultiLists
Head
100
HEADER of the linked list is the first element in the list and it
stores the number of elements in the List.It points to the First data element
of the List.
Head
100
Pop(s) Push(x,s)
STACK S
Top(s)
Implementation of STACK:
Array Implementation
Linked List Implementation
Disadvantages:
Expression conversion
Expression Evaluation
Function call
Balancing Symbols
Recursion
Towers of Hanoi
17.Define QUEUE ADT?
Dequeue(x,Q) Enqueue(x,Q)
QUEUE Q
Implementation of QUEUE:
Array implementation
Linked List Implementation
Circular Queue implementation
When the Queue full Q-FRONT and Q-REAR reaches the end of the
array. It is wrapped around the Beginning.
10 20
Q-FRONT Q-REAR
X 10 20
Q-REAR Q-FRONT
19.Give the applications of QUEUE?
Job Scheduling
Categorizing Data
n
F(x)= AiXi
i=0
EX:
X5+2X3+X
1 5 2 3 1 1 NULL