1. DATA STRUCTURE
ASSIGNMENT NO 1
TEAM 8
MULTIPLY LINKED LIST
TEAM MEMBERS
ANAND. S _ 13MX03
DHIVYA. K. S _ 13MX09
KARTHIK. A.R _ 13MX21
MALATHI. A _ 13MX25
YOGESHWARI _ 13MX54
2. Linked list
• A Linked representation of data structure is
known as a linked list, Which is a collection of
nodes.
• Each node is a collection of fields categorized as
data items and links.
3. Merits of linked data structure
• Efficient implementation of insertion and
deletion operations.
• Efficient usage of storage memory.
4. Multiple linked list
• In multiple linked list, each node contains two or
more link fields, each field being used to connect
the same set of data records in a different order.
• Eg : By name, By department etc, . .
5. MULTIPLY LINKED LIST
Linked representation with multiple data
and link fields.
Multiply linked representation of the list L
is a network of nodes which are connected
to one another based on some associations.
6.
7. Node structure of a multiply linked list:
LINK 2
…
DATA1 DATA2 … DATA X LINK 1
LINK 4
LINK 3
LINK m-
1
LINK m
8. EXAMPLE 1: Student details for representation as
a multiply linked list
Name of
the student
Roll no: No of
Credits
Sports Club
Membership
Day
Student
Department
ARUN MX05 200 YES YES DCA
BABU ME12 210 N0 YES DME
LAKSHMI MX23 210 YES NO DCA
RAM CE40 190 YES NO DCE
GURU CS35 190 NO YES DCS
SREE CE46 220 YES NO DCE
9. Node structure of the multiply linked list
student:
Sports Club Men
Name of Name of
the student the Credits
Registered
Roll no
Day Student
Dept Enroll
10. Multiply linked list structure of list student
ARUN MX05 200 YES YES DCA
BABU ME12 210 N0 YES DME
LAKSHMI MX23 210 YES NO DCA
RAM CE40 190 YES NO DCE
SCM - Sports Club Membership
11. DS
DS - DAY STUDENT
ARUN MX05 200 YES YES DCA
BABU ME12 210 N0 YES DME
LAKSHMI MX23 210 YES NO DCA
GURU CS35 190 NO YES DCS
SREE CE46 220 YES NO DCE
12. D
D- DEPARTMENT NAME
ARUN MX05 200 YES YES DCA
RAM CE40 190 YES NO DCE
LAKSHMI MX23 210 YES NO DCA
BABU ME12 210 N0 YES DME
SREE CE46 220 YES NO DCE
GURU CS35 190 NO YES DCS
13. Insert ALI into the multiply linked list student
ALI DCS 200 YES NO DCS
ARUN MX05 200 YES YES DCA
GURU CS35 190 NO YES DCS
BABU ME12 210 N0 YES DME
ALI DCS 200 YES NO DCS
14. Delete SREE from the Sports Club Membership
list from student:
BEFORE DELETING :
RAM CE40 190 YES NO DCE
SREE CE46 220 YES NO DCE
AFTER DELETING :
RAM CE40 190 YES NO DCE
SREE CE46 220 YES NO DCE
15. Example 2 Sparse Matrix
The sparse matrix is a matrix with zeros as the
dominating elements.
7 8 5 3
4 6 2 1
5 3 2 9
1 4 9 2
7 0 0 0
0 0 0 0
0 0 1 0
0 2 0 0
Matrix Sparse Matrix
17. Each non zero element of the matrix is
represented using the node structure. Here
ROW, COL and DATA fields record the row ,
column and values of the non zero elements in
the matrix.
The RIGHT link points to the node holding
the next non zero value in the same row of the
matrix.
The LEFT link points to the node holding the
next non zero value in the same column of the
matrix.
19. • The objective of the addition of polynomial is to
perform a symbolic addition of two polynomials.
• p1 :2x^ 6 + x^3+5x+4
• P2: 7x^6+8x^5-9x^3+10x^2+14
Be the two polynomials over a variable x.
The objective is to obtain the algebraic sum of p1
and p2 as,
p1+p2=9x^6+8x^5-8x^3+10x^2+5x+18.