重庆大学数据结构ppt12_Array(seminar)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

DataStructureDataStructureCollegeofComputerScience,CQUSeminar:FastMatrixTransposingDataStructureDataStructureArrays_02Arrays_02FastMatrixTransposingDiscussion:comparedwith2Discussion:comparedwith2--DarrayrepresentationDarrayrepresentationO(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_02FastMatrixTransposingSolution:Solution:First,determinethenumberofelementsineachFirst,determinethenumberofelementsineachcolumnoftheoriginalmatrix.columnoftheoriginalmatrix.Second,determinethestartingpositionsofeachrowSecond,determinethestartingpositionsofeachrowinthetransposematrix.inthetransposematrix.DataStructureDataStructureArrays_02Arrays_02FastMatrixTransposingYouaretocreateprogramstotransposeamatrixtransposeamatrixrepresentedasasequenceoftriplesinO(columns+representedasasequenceoftriplesinO(columns+elements)elements)DataStructureDataStructureArrays_02Arrays_02Reference《数据结构(C语言版)》,严蔚敏,吴伟民编著,清华大学出版社,1997年第1版,P91-99DataStructureDataStructureArrays_02Arrays_02-End-

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功