四應用題
三維數組以行為主序存儲其元素地址公式為
其中cidi是各維的下界和上界Vi=dici+是各維元素個數L是一個元素所占的存儲單元數
b對角矩陣的b條對角線在主對角線上方和下方各有?b/?條對角線(為敘述方便下面設a=?b/?)從第行至第a行每行上的元素數依次是a+a+bb最後的a行上的元素個數是 bba+中間的(na )行每行元素個數都是b故b條對角線上元素個數為 (na)b+a*(a+b)存放在一維數組V[nba(ba)]中其下標k與元素在二維數組中下標i和j的關系為
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/23047.html