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

正文內(nèi)容

[工學(xué)]chap2順序表-文庫吧資料

2024-10-24 23:34本頁面
  

【正文】 rn (name+”,”+phoneNumber+”,“+ addr)。 } public boolean equals(object obj){ if((obj)) return true。 =phoneNumber。 String addr。 第二章 線性表 29 數(shù)據(jù)類型定義 public class Address{ String name。 當(dāng)數(shù)據(jù)元素不是已有數(shù)據(jù)類型時必須先定義數(shù)據(jù)元素類,如果有查找需要,還應(yīng)該重寫 equals方法。 } } 第二章 線性表 27 ? 改為上邊的代碼以后: ?如果順序表的實(shí)現(xiàn)類發(fā)生變化,例如變成了我們下一章將要講的鏈表,那么這個應(yīng)用程序要改動的部分就只有上邊的程序的 main方法中的一行程序, playList方法不用作任何修改。 ((3))。 (3,new Integer(3))。 (“整形數(shù) 4位于第三個元素 ” )。 (“查找整形數(shù) 4的位置 ” )。 (new Integer(5))。 (new Integer(2))。 playList(intList)。那么為什么要這么做呢?如果考慮到要降低模塊間的耦合程度,這樣做就是非常重要的。 第二章 線性表 25 一個問題 ? 本例中對象 intList被定義為 LinearList類型,初始化的對象是 ArrayList類型,并且在后邊的代碼中僅使用 LinearList的方法。 (())。 (“輸出第 3個元素值, ” )。 (“在第 3個元素之前,插入數(shù)據(jù) 3”)。 int k=(new Integer(4))。 (new Integer(6))。 (new Integer(4))。 (new Integer(1))。 } 第二章 線性表 22 例 [21] ? 使用線性表類構(gòu)造一個保存整形數(shù)的線性表,插入若干數(shù)據(jù),查找其中的指定數(shù)據(jù) ,打印線性表。i++) ret=table[i].toString()+ “ ”。 for(int i=0。 return true。k++) //將 from到 to的元素向前移動一個位置 table[k1]=table[k]。 for (int k=from。 } public boolean remove(){//刪除當(dāng)前位置數(shù)據(jù)元素 if(isEmpty()) true。 size。 k=to。 int from=i, to=size1。 if(i1) i=1。 } return null。 while(isize){ if(table[i].equals(obj)) return table[i]。 } return 1。 while(isize){ if(table[i].equals(obj)) return i+1。 return true。 table[size]=obj。 } a1 a2 a3 a4 a5 a6 a7 a8 a9 OBJ 第二章 線性表 18 插入數(shù)據(jù)元素 public boolean insert(Object obj)。 table[from]=obj。 k=from。 } int from=i1, to=size1。 size++。 } if(i1) i=1。 size=1。 } 第二章 線性表 17 插入數(shù)據(jù)元素 public boolean insert(int i, Object obj){// 將 obj插入到指定位置 i之前 if(isFull()) return false。 table[current]=obj。 current =) return null。 if(current0 amp。 } public Object set(Object obj){ //替換當(dāng)前位置數(shù)據(jù)元素為 obj Object tem。 table[i1]=obj。 if(isize) i=size。 if(!isEmpty()) return null。 return tem。 tem= table[current]。 current =) return null。 if(current0 amp。 return table[i1]。 if(i1) i=1。 } public boolean isFull(){ return size=。 private int size。 … public int lentgh(){ return size。 } 第二章 線性表 12 求線性表的長度 public class ArrayList extends LinearList{ private int table[]。 //分配內(nèi)存給 Table size=0。 } 第二章 線性表 11 順序表的操作 順序表的初始化 順序表的初始化就是類 ArrayList的構(gòu)造方法。 int size。 //按關(guān)鍵字升序?qū)?shù)據(jù)元素進(jìn)行排序 abstract public void sort(int from, int to, int order)// 對線性表中從 from到 to位置的元素進(jìn)行排序 /*以字符串輸出線性表 */ abstract public String toString()。//刪除指定位置數(shù)據(jù)元素 abstract public boolean remove()。 //返回對象 obj第一次出現(xiàn)的位置,查找不到時,返回 1 abstract public Object search(Object obj)。// 將 obj插入到指定位置 i之前 abstract public boolean insert(Object obj)。 //替換指定位置數(shù)據(jù)元素為 obj abstract public void seek(int curr)。 //取得指定位置( i0)的數(shù)據(jù)元素 abstract public Object get()。 /*判斷是否為滿 */ a
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1