SlideShare a Scribd company logo
Sparse Matrix
DINCY R ARIKKAT
Sparse Matrix
 Sparse matrix is a matrix in which most of the element are zero.
 By contrast if the most element are non zero then matrix is Dense.
 Sparsity of sparse matrix is the number of zero valued elements divided by total
no. of element.
 The following sparse matrix contains only 16 nonzero elements, with 84 zero
elements. Its sparsity is 84%, and its density is 16%. SPARSE MATRIX
Sparse Matrix
 When a sparse matrix is represented with a 2-dimensional array, we waste a lot of
space to represent that matrix.
 For example, consider a matrix of size 100 X 100 containing only 10 non-zero
elements.
 In this matrix, only 10 spaces are filled with non-zero values and remaining spaces
of the matrix are filled with zero.
 That means, totally we allocate 100 X 100 X 2 = 20000 bytes of space to store this
integer matrix.
 And to access these 10 non-zero elements we have to make scanning for 10000
times. To make it simple we use the following sparse matrix representation.
Sparse Matrix Representations
A sparse matrix can be represented by using TWO representations, those are as
follows...
 Triplet Representation (Array Representation)
 Linked Representation
Triplet Representation (Array
Representation)
 In this representation, we consider only non-zero values along with their row and
column index values.
 In this representation, the 0th row stores the total number of rows, total number
of columns and the total number of non-zero values in the sparse matrix.
 For example, consider a matrix of size 5 X 6 containing 6 number of non-zero
values. This matrix can be represented as shown in the image...
Triplet representation
 In this example, there are only 6 non-zero elements ( those are 9, 8,
4, 2, 5 & 2) and matrix size is 5 X 6. We represent this matrix as
shown in the above image. Here the first row in the right side table is
filled with values 5, 6 & 6 which indicates that it is a sparse matrix
with 5 rows, 6 columns & 6 non-zero values. The second row is filled
with 0, 4, & 9 which indicates the non-zero value 9 is at the 0th-row
4th column in the Sparse matrix. In the same way, the remaining non-
zero values also follow a similar pattern.
Algorithm
Algorithm(continues…)
Algorithm(continues…)
Thank You

More Related Content

What's hot

Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
Awais Alam
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
International Islamic University
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structureSajid Marwat
 
Array operations
Array operationsArray operations
Array operations
ZAFAR444
 
Array data structure
Array data structureArray data structure
Array data structure
maamir farooq
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data Structures
SHAKOOR AB
 
Bubble Sort Algorithm Presentation
Bubble Sort Algorithm Presentation Bubble Sort Algorithm Presentation
Bubble Sort Algorithm Presentation
AhmedAlbutty
 
Queues
QueuesQueues
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting Algorithms
Rahul Jamwal
 
Arrays
ArraysArrays
sorting and its types
sorting and its typessorting and its types
sorting and its types
SIVASHANKARIRAJAN
 
Sorting
SortingSorting
Arrays
ArraysArrays
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Heap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithmsHeap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithms
samairaakram
 
Stack
StackStack
linear search and binary search
linear search and binary searchlinear search and binary search
linear search and binary search
Zia Ush Shamszaman
 
Selection sort
Selection sortSelection sort
Selection sort
stella D
 
Binary Search
Binary SearchBinary Search
Binary Search
kunj desai
 

What's hot (20)

Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
 
Array operations
Array operationsArray operations
Array operations
 
Array data structure
Array data structureArray data structure
Array data structure
 
Heap tree
Heap treeHeap tree
Heap tree
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data Structures
 
Bubble Sort Algorithm Presentation
Bubble Sort Algorithm Presentation Bubble Sort Algorithm Presentation
Bubble Sort Algorithm Presentation
 
Queues
QueuesQueues
Queues
 
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting Algorithms
 
Arrays
ArraysArrays
Arrays
 
sorting and its types
sorting and its typessorting and its types
sorting and its types
 
Sorting
SortingSorting
Sorting
 
Arrays
ArraysArrays
Arrays
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
Heap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithmsHeap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithms
 
Stack
StackStack
Stack
 
linear search and binary search
linear search and binary searchlinear search and binary search
linear search and binary search
 
Selection sort
Selection sortSelection sort
Selection sort
 
Binary Search
Binary SearchBinary Search
Binary Search
 

Similar to Sparse matrix

Matrix
MatrixMatrix
Matrix
Umar Farooq
 
Matrices
MatricesMatrices
Matrices
ashishtqm
 
Presentation On Matrices Mathematics DIU
Presentation On Matrices Mathematics DIUPresentation On Matrices Mathematics DIU
Presentation On Matrices Mathematics DIU
Shuvo Shuvo
 
Matrix.
Matrix.Matrix.
Matrix.
Awais Bakshy
 
Introduction to matices
Introduction to maticesIntroduction to matices
Introduction to matices
Raza Tuition center
 
Matrix and its applications by mohammad imran
Matrix and its applications by mohammad imranMatrix and its applications by mohammad imran
Matrix and its applications by mohammad imran
Mohammad Imran
 
BASIC CONCEPT OF MATRIX.pptx
BASIC CONCEPT OF MATRIX.pptxBASIC CONCEPT OF MATRIX.pptx
BASIC CONCEPT OF MATRIX.pptx
CHIRANTANMONDAL2
 
Realnumbersystemnotes
RealnumbersystemnotesRealnumbersystemnotes
Realnumbersystemnotes
im8th2
 
Matrices and Determinants
Matrices and DeterminantsMatrices and Determinants
Matrices and Determinants
SOMASUNDARAM T
 
MATRICES
MATRICESMATRICES
MATRICES
Misbah Aazmi
 
IB Maths SL Matrices
IB Maths SL Matrices IB Maths SL Matrices
IB Maths SL Matrices estelav
 
Aji
AjiAji
2 data structure in R
2 data structure in R2 data structure in R
2 data structure in R
naroranisha
 
DSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notesDSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notes
swathirajstar
 
Types of Matrics
Types of MatricsTypes of Matrics
Types of Matrics
Narmatha Devi N
 
Number system.pdf
Number system.pdfNumber system.pdf
Number system.pdf
DeepuGuna
 
Definitions matrices y determinantes fula 2010 english subir
Definitions matrices y determinantes   fula 2010  english subirDefinitions matrices y determinantes   fula 2010  english subir
Definitions matrices y determinantes fula 2010 english subirHernanFula
 
Linear Algebra Presentation including basic of linear Algebra
Linear Algebra Presentation including basic of linear AlgebraLinear Algebra Presentation including basic of linear Algebra
Linear Algebra Presentation including basic of linear Algebra
MUHAMMADUSMAN93058
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
JinTaek Seo
 

Similar to Sparse matrix (20)

Matrix
MatrixMatrix
Matrix
 
Matrices
MatricesMatrices
Matrices
 
Presentation On Matrices Mathematics DIU
Presentation On Matrices Mathematics DIUPresentation On Matrices Mathematics DIU
Presentation On Matrices Mathematics DIU
 
Matrix.
Matrix.Matrix.
Matrix.
 
Introduction to matices
Introduction to maticesIntroduction to matices
Introduction to matices
 
Matrix and its applications by mohammad imran
Matrix and its applications by mohammad imranMatrix and its applications by mohammad imran
Matrix and its applications by mohammad imran
 
BASIC CONCEPT OF MATRIX.pptx
BASIC CONCEPT OF MATRIX.pptxBASIC CONCEPT OF MATRIX.pptx
BASIC CONCEPT OF MATRIX.pptx
 
Realnumbersystemnotes
RealnumbersystemnotesRealnumbersystemnotes
Realnumbersystemnotes
 
Matrices and Determinants
Matrices and DeterminantsMatrices and Determinants
Matrices and Determinants
 
MATRICES
MATRICESMATRICES
MATRICES
 
IB Maths SL Matrices
IB Maths SL Matrices IB Maths SL Matrices
IB Maths SL Matrices
 
Aji
AjiAji
Aji
 
2 data structure in R
2 data structure in R2 data structure in R
2 data structure in R
 
DSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notesDSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notes
 
Types of Matrics
Types of MatricsTypes of Matrics
Types of Matrics
 
Number system.pdf
Number system.pdfNumber system.pdf
Number system.pdf
 
Definitions matrices y determinantes fula 2010 english subir
Definitions matrices y determinantes   fula 2010  english subirDefinitions matrices y determinantes   fula 2010  english subir
Definitions matrices y determinantes fula 2010 english subir
 
Linear Algebra Presentation including basic of linear Algebra
Linear Algebra Presentation including basic of linear AlgebraLinear Algebra Presentation including basic of linear Algebra
Linear Algebra Presentation including basic of linear Algebra
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
 
Direct methods
Direct methodsDirect methods
Direct methods
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 

Sparse matrix

  • 2. Sparse Matrix  Sparse matrix is a matrix in which most of the element are zero.  By contrast if the most element are non zero then matrix is Dense.  Sparsity of sparse matrix is the number of zero valued elements divided by total no. of element.  The following sparse matrix contains only 16 nonzero elements, with 84 zero elements. Its sparsity is 84%, and its density is 16%. SPARSE MATRIX
  • 3. Sparse Matrix  When a sparse matrix is represented with a 2-dimensional array, we waste a lot of space to represent that matrix.  For example, consider a matrix of size 100 X 100 containing only 10 non-zero elements.  In this matrix, only 10 spaces are filled with non-zero values and remaining spaces of the matrix are filled with zero.  That means, totally we allocate 100 X 100 X 2 = 20000 bytes of space to store this integer matrix.  And to access these 10 non-zero elements we have to make scanning for 10000 times. To make it simple we use the following sparse matrix representation.
  • 4. Sparse Matrix Representations A sparse matrix can be represented by using TWO representations, those are as follows...  Triplet Representation (Array Representation)  Linked Representation
  • 5. Triplet Representation (Array Representation)  In this representation, we consider only non-zero values along with their row and column index values.  In this representation, the 0th row stores the total number of rows, total number of columns and the total number of non-zero values in the sparse matrix.  For example, consider a matrix of size 5 X 6 containing 6 number of non-zero values. This matrix can be represented as shown in the image...
  • 6. Triplet representation  In this example, there are only 6 non-zero elements ( those are 9, 8, 4, 2, 5 & 2) and matrix size is 5 X 6. We represent this matrix as shown in the above image. Here the first row in the right side table is filled with values 5, 6 & 6 which indicates that it is a sparse matrix with 5 rows, 6 columns & 6 non-zero values. The second row is filled with 0, 4, & 9 which indicates the non-zero value 9 is at the 0th-row 4th column in the Sparse matrix. In the same way, the remaining non- zero values also follow a similar pattern.