Presentation 3
Presentation 3
Linear
Data
Structure
Linked list based
polynomial
addition
• Presented by :
Surya Prakash
Naveen
Thalapathi
Santhosh
Kamalesh
Topics :
• Polynomial
• Linked list
• Polynomial addition
• Special case handling
• Time and space complexity
• Advantage and disadvantage of linked lis
• Real world application
Introduction
Polynomial operations are fundamental in various
domains including mathematics, physics, and computer
science.
• General structure
P(x)=anxn+an−1xn−1+…+a1x+a0
Sparse Polynomial:
Input format:
o Number of terms
o Each term entered as a pair: (coefficient,
exponent)
// Adding corresponding
coefficients Output:
for (int i = 0; i < size; i++) Resultant
{ Polynomial: 5x^2 + 9x^1 + 7x^0
Future Scope &
Enhancements
•Imagine two grocery lists, each created by different people
•List A: 2 Milk, 3 Eggs, 1 Bread
•List B: 1 Milk, 2 Bread, 4 Apples
•🧠 When combining both lists:
Space Complexity:
o O(m + n) in the worst case (if no common terms).
✅ Simplifies polynomial
arithmetic operations like
subtraction and multiplication.
Limitations of
Linked List
Representation
❌ No direct (random)
access to specific
elements.
❌ Slightly higher memory
overhead due to storing
pointers.
❌ More complex logic
needed for sorting and
merging.
❌ Traversal is
sequential — can be
slower for very long
polynomials.
Real-World Applications
Dynamic, only
Fixed size, can waste
Memory Usage stores non-zero
space for zeros
terms
Costly due to Efficient with
Insertion/Deletion
shifting pointer changes
Flexibility Rigid structure Highly flexible
Suitable for
Sparse ❌ No ✅ Yes
Polynomials?