文件名称:k
介绍说明--下载内容均来自于网络,请自行研究使用
对于稀疏矩阵的存储,可不使用二维数组来存储,而使用链表,只存储其中的非0元素。链表中的每个结点包含的域为(行,列,值, next),如以下稀疏矩阵:
0 2 0 0 0
3 0 0 0 6
0 0 0 0 0
0 0 7 0 0
则链表为:
请实现两个稀疏矩阵的相加,并输出结果。要求:相加后原来的两个矩阵仍然存在。-For sparse matrix storage, without using the two-dimensional array to store and use the list, which stores only the non-zero elements. Fields included for each node in the linked list (row, column, values, Next), such as the following sparse matrix: 0,200,030,006,000,000,070 0 list is: The addition of two sparse matrix, and outputs the result. Requirement: the sum of the original two matrices persists.
0 2 0 0 0
3 0 0 0 6
0 0 0 0 0
0 0 7 0 0
则链表为:
请实现两个稀疏矩阵的相加,并输出结果。要求:相加后原来的两个矩阵仍然存在。-For sparse matrix storage, without using the two-dimensional array to store and use the list, which stores only the non-zero elements. Fields included for each node in the linked list (row, column, values, Next), such as the following sparse matrix: 0,200,030,006,000,000,070 0 list is: The addition of two sparse matrix, and outputs the result. Requirement: the sum of the original two matrices persists.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
稀疏矩阵相加.cpp