freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

[計算機]3第二章線性表2本(編輯修改稿)

2024-11-12 22:57 本頁面
 

【文章內(nèi)容簡介】 { get { return next。 } set { next = value。 } } } 單鏈表類 單鏈表類的成員變量至少要有兩個:一個是頭指針 ,另一個是單鏈表中的數(shù)據(jù)元素個數(shù) 。 但是 , 如果再增加一個表示單鏈表當(dāng)前結(jié)點位置的成員變量 , 則有些成員函數(shù)的設(shè)計將更加方便 。 class LinList:List { Node head。 Node current。 int size。 public LinList() { head = current = new Node(null)。 } head current ^ 定位成員函數(shù) index(int i): 按照參數(shù) i指定的位置,讓當(dāng)前結(jié)點位置成員變量 current表示該結(jié)點。 設(shè)計方法: 用一個循環(huán)過程從頭開始計數(shù)尋找第 i個數(shù)據(jù)元素。循環(huán)初始時, current=,當(dāng)計數(shù)到 current表示第 i個數(shù)據(jù)元素時,循環(huán)結(jié)束。 current = 。 int j = 0。 while((current != null) amp。amp。 j i){ current=。 j ++。} ... a0 head a1 an1 ^ current public void index(int i) { if (i 1 || i size 1) { throw new Exception(參數(shù)錯誤! )。 } if (i == 1) { current = head。 return。 } current = 。 int j = 0。 while ((current != null) amp。amp。 j i) { current = 。 j++。 } } 在單鏈表中插入一個元素 obj的示意圖如下: obj s 鏈表插入的核心語句: Step 1: =。 Step 2: =s ; 思考: Step1和 2能互換嗎? b a current 插 入 obj
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1