[理工] [DS] 補習班考題計算Array

看板Grad-ProbAsk作者 (PT鄉民)時間12年前 (2012/03/16 19:26), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/3 (看更多)
Let A be a two-dimensional array. The address of A[4][2] is 1978 and A[2][3] is 1986. Assume that each element of A occupies two bytes. (a)Find the address of A[3][8]. (b)Find the number of rows of A. 以上今日的練習考題 出來題目 腦中一片空白!! 不知道有人可以提供我"完整解法"嗎?? 感覺這好像很基礎~~但是我看講義好像也沒出的那麼細微呀@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.39.4.238

03/16 21:58, , 1F
想不出公式就用暴力法吧~~這題是column major
03/16 21:58, 1F

03/16 22:00, , 2F
2byte 2byte 慢慢加就好
03/16 22:00, 2F
文章代碼(AID): #1FOoDF0q (Grad-ProbAsk)
文章代碼(AID): #1FOoDF0q (Grad-ProbAsk)