10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

where "*" means you can store any value from 1 to 6 in that position<br />

in the array.<br />

2. Compressed‐Diagonal Storage Mode<br />

The storage mode used for square sparse matrices stored in<br />

compressed‐diagonal storage mode has two variations, depending<br />

on whether the matrix is a general sparse matrix or a symmetric<br />

sparse matrix. This explains both of these variations; however, the<br />

conventions used for numbering the diagonals in the matrix, which<br />

apply to the storage descriptions, are explained first.<br />

Matrix A of order n has 2n‐1 diagonals. Because k = j‐i is constant<br />

for the elements aij along each diagonal, each diagonal can be<br />

assigned a diagonal number, k, having a value from 1‐n to n‐<strong>1.</strong> Then<br />

the diagonals can be referred to as dk, where k = 1‐n, n‐<strong>1.</strong><br />

The following matrix shows the starting position of each diagonal,<br />

dk:<br />

For a general (square) sparse matrix A, compressed‐diagonal<br />

storage mode uses two arrays to define the sparse matrix storage,<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 128 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!