您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 重庆大学数据结构ppt12_Array(seminar)
DataStructureDataStructureCollegeofComputerScience,CQUSeminar:FastMatrixTransposingDataStructureDataStructureArrays_02Arrays_02FastMatrixTransposingDiscussion:comparedwith2Discussion:comparedwith2--DarrayrepresentationDarrayrepresentationO(columns*elements)vs.O(columns*rows)O(columns*elements)vs.O(columns*rows)elementselements----columns*rowswhennoncolumns*rowswhennon--sparse,sparse,O(columnsO(columns22*rows)*rows)Problem:ScanthearrayProblem:Scanthearray““columnscolumns””times.times.HowcanHowcanwetransposeamatrixrepresentedasawetransposeamatrixrepresentedasasequenceoftriplesinO(columns+elements)sequenceoftriplesinO(columns+elements)timetime??DataStructureDataStructureArrays_02Arrays_02FastMatrixTransposingSolution:Solution:First,determinethenumberofelementsineachFirst,determinethenumberofelementsineachcolumnoftheoriginalmatrix.columnoftheoriginalmatrix.Second,determinethestartingpositionsofeachrowSecond,determinethestartingpositionsofeachrowinthetransposematrix.inthetransposematrix.DataStructureDataStructureArrays_02Arrays_02FastMatrixTransposingYouaretocreateprogramstotransposeamatrixtransposeamatrixrepresentedasasequenceoftriplesinO(columns+representedasasequenceoftriplesinO(columns+elements)elements)DataStructureDataStructureArrays_02Arrays_02Reference《数据结构(C语言版)》,严蔚敏,吴伟民编著,清华大学出版社,1997年第1版,P91-99DataStructureDataStructureArrays_02Arrays_02-End-
本文标题:重庆大学数据结构ppt12_Array(seminar)
链接地址:https://www.777doc.com/doc-6498593 .html