0% found this document useful (0 votes)
4 views

Question

Uploaded by

lks992004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Question

Uploaded by

lks992004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Data Structures Lab

Lab Assignment – 3
1. Write a program to implement the concept of polynomial addition. Create two linked
lists corresponding to the input polynomials to perform the addition. Print the result in
the form of equation.
Example:
Input Polynomial Equations:
P1: 5x8 + 15x6 + 7x4 + 22x2 + 12x + 29
P2: 32x8 + 13x7 + 18x6 + 16x5 + 22x3 + 45

Output Polynomial Equation:


P3: 37x8 + 13x7 + 33x6 + 16x5 + 7x4 + 22x3 + 22x2 + 12x + 74

2. Write a program to implement the concept of polynomial multiplication. Create two


linked lists corresponding to the input polynomials to perform the addition. Print the
result in the form of equation.
Example:
Input Polynomial Equations:
P1: 5x8 + 15x6 + 7x4 + 22x2 + 12x + 29
P2: 32x8 + 13x7 + 18x6 + 16x5 + 22x3 + 45

3. Write a program to create a double linked list of size N. Take input from the user for the
size and data elements to be stored. Print the created double linked list.

4. Write a program to insert three nodes at the end of the double linked list and print the
updated linked list.

5. Write a program to delete a node having value “X” from the double linked list and print
the updated linked list. Take the value of “X” as input from user.

Bonus Task:
Create a single program having menu of different operations to be performed on the double
linked list. For instance:

Select an option:
- Create a double linked list
o Take requirement from the user
- Insert a node in the double linked list
o Take requirement from the user
- Delete a node in the double linked list
o Take requirement from the user
- Display the elements of the double linked list

You might also like