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 />

| 11 0 13 0 0 0 |<br />

| 21 22 0 24 0 0 |<br />

| 0 32 33 0 0 0 |<br />

| 0 0 43 44 0 46|<br />

| 0 0 0 0 0 0|<br />

| 61 62 0 0 0 66 |<br />

the arrays are:<br />

AR = (11, 13, 24, 22, 21, 32, 33, 44, 43, 46, 61, 62, 66)<br />

IA = (1, 3, 6, 8, 11, 11, 14)<br />

JA = (1, 3, 4, 2, 1, 2, 3, 4, 3, 6, 1, 2, 6)<br />

PROGRAMS FOR VARIOUS OPERATIONS PERFORMED ON MATRIX<br />

• FOR ADDITION:‐<br />

#include<br />

#include<br />

void create_m(int [10][10],int,int);<br />

void display_m(int [10][10],int,int);<br />

void add_m(int [10][10],int [10][10],int,int);<br />

int i,j,k,a[10][10],b[10][10],c[10][10];<br />

void main ()<br />

{<br />

int m,n,p,q,ch;<br />

clrscr();<br />

while(1)<br />

{<br />

printf("\nenter the nums of row and column of matrix A\n");<br />

scanf("%d%d",&m,&n);<br />

create_m(a,m,n);<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

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

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

Saved successfully!

Ooh no, something went wrong!