Beruflich Dokumente
Kultur Dokumente
h>
#include<stdlib.h>
typedef struct
int row;
int col;
int val;
}sparse;
int i, j, k, item, p;
a[0].row = m;
a[0].col = n;
k = 1;
scanf("%d",&item);
if(item == 0)
continue;
a[k].row = i;
a[k].col = j;
a[k].val = item;
k++;
}
a[0].val = k-1;
printf("\nRow\tColumn\tValue\n");
printf("%d\t", a[p].row);
printf("%d\t", a[p].col);
printf("%d\n", a[p].val);
int i, j, p;
b[0].row = numCols;
b[0].col = a[0].row;
b[0].val = numTerms;
if(numTerms>0)
row_terms[i] = 0;
start_pos[0]=1;
j = start_pos[a[i].col]++;
b[j].row = a[i].col;
b[j].col = a[i].row;
b[j].val = a[i].val;
printf("\nRow\tColumn\tValue\n");
printf("%d\t", b[p].row);
printf("%d\t", b[p].col);
printf("%d\n", b[p].val);
void main()
int m, n, key;
scanf("%d%d",&m, &n);
readsparse(a, m, n);
fast_transpose(a, b);
/*
1234
0780
0046
2506
4 4 11
0 0 1
0 1 2
0 2 3
0 3 4
1 1 7
1 2 8
2 2 4
2 3 6
3 0 2
3 1 5
3 3 6
4 4 11
0 0 1
0 3 2
1 0 2
1 1 7
1 3 5
2 0 3
2 1 8
2 2 4
3 0 4
3 2 6
3 3 6
/*