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

正文內(nèi)容

順序表鏈表kmp實(shí)驗(yàn)報(bào)告(編輯修改稿)

2024-11-12 02:14 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 SeqList::~SeqList() { delete[]list。 } //返回長(zhǎng)度 int SeqList::list_size() { return size。 } //插入函數(shù) int SeqList::list_insert(int i,int item) { if(isize+1||i0||size==maxsize)return error。 if(i==size+1) { list[i1]=item。 size++。 return ok。 } int j。 for(j=size。ji1。j) { list[j]=list[j1]。 } list[j]=item。 size++。 return ok。 } //刪除函數(shù) int SeqList::list_del(int i) { if(isize||i0||size==0)return error。 int j。 for(j=i1。jsize1。j++) { list[j]=list[j+1]。 } size。 return ok。 } //返回值函數(shù) int SeqList::list_get(int i) { if(i=0||isize)return error。 return list[i1]。 } //輸出函數(shù) void SeqList::list_display() { int j。 for(j=0。jsize。j++) { coutlist[j] 。 } coutendl。 } int main() { int n,i,NUM,position。 SeqList L。 //第 1 行先輸入 n 表示 有 n 個(gè)數(shù)據(jù),即 n 是實(shí)際長(zhǎng)度;接著輸入 n 個(gè)數(shù)據(jù) cinn。 for(i=0。in。i++) { cinNUM。 (i+1,NUM)。 } cout() 。 ()。 //第 2 行輸入要插入的位置和新數(shù)據(jù) cinpositionNUM。 if((position,NUM)==1)couterrorendl。 else { cout() 。 ()。 } //第 3 行輸入要插入的位置和新數(shù)據(jù) cinpositionNUM。 if((position,NUM)==1)couterrorendl。 else { cout() 。 ()。 } //第 4 行輸入要?jiǎng)h除的位置 cinposition。 if((position)==1)couterrorendl。 else { cout() 。 ()。 } //第 5 行輸入要?jiǎng)h除的位置 cinposition。 if((position)==1)couterrorendl。 else { cout() 。 ()。 } //第 6 行輸入要查找的位置 cinposition。 if((position)==1)couterrorendl。 else cout(position)endl。 //第 7 行輸入要查找的位置 cinposition。 if((position)==1)couterrorendl。 else cout(position)endl。 return 0。 } B: DS 順序表 連續(xù)操作 includeiostream using namespace std。 define ok 0 define error 1 //順序表類定義 class SeqList { private: int *list。 int maxsize。 int size。 public: SeqList()。 ~SeqList()。 int list_size()。 int list_insert(int i,int item)。 int list_del(int i)。 int list_get(int i)。 void list_display()。 }。 //構(gòu)造函數(shù) SeqList::SeqList() { maxsize=1000。 size=0。 list=new int[maxsize]。 } //析構(gòu)函數(shù) SeqList::~SeqList() { delete[]list。 } //返回長(zhǎng)度 int SeqList::list_size() { return size。 } //插入函數(shù) int SeqList::list_insert(int i,int item) { if(isize+1||i0||size==maxsize)return error。 if(i==size+1) { list[i1]=item。 size++。 return ok。 } int j。 for(j=size。ji1。j) { list[j]=list[j1]。 } list[j]=item。 size++。 return ok。 } //刪除函數(shù) int SeqList::list_del(int i) { if(isize||i0||size==0)return error。 int j。 for(j=i1。jsize1。j++) { list[j]=list[j+1]。 } size。 return ok。 } //返回值函數(shù) int SeqList::list_get(int i) { if(i=0||isize)return error。 return list[i1]。 } //輸出函數(shù) void SeqList::list_display() { int j。 for(j=0。jsize。j++) { coutlist[j] 。 } coutendl。 } int main() { int n,i,NUM,k,j。 SeqList L。 //第 1 行先輸入 n 表示有 n 個(gè)數(shù) 據(jù),即 n 是實(shí)際長(zhǎng)度;接著輸入 n 個(gè)數(shù)據(jù) cinn。 for(j=0。jn。j++) { cinNUM。 (j+1,NUM)。 } cout() 。 ()。 //第 2 行先輸入 i 表示插入開始的位置,再輸入 k 表示有 k 個(gè)插入數(shù)據(jù),接著輸入 k 個(gè)數(shù)據(jù) cinik。 for(j=0。jk。j++) { cinNUM。 (i++,NUM)。 } cout() 。 ()。 //第 3 行先輸入 i 表示刪除開始的位置,再輸入 k 表示要?jiǎng)h除 k 個(gè)數(shù)據(jù) cinik。 for(j=0。jk。j++) { (i)。 } cout() 。 ()。 return 0。 } 3. Problem C: DS 順序表 合并操作 includeiostream using namespace std。 define ok 0 define error 1 //順序表類定義 class SeqList { private: int *list。 int maxsize。 int size。 public: SeqList()。 ~SeqList()。 int list_size()。 int list_insert(int i,int item)。 int list_del(int i)。 int list_get(int i)。 void list_display()。 }。 //構(gòu)造函數(shù) SeqList::SeqList() { maxsize=1000。 size=0。 list=new int[maxsize]。 } //析構(gòu)函數(shù) SeqList::~SeqList() { delete[]list。 } //返回長(zhǎng)度 int SeqList::list_size() { return size。 } //插入函數(shù) int SeqList::list_insert(int i,int item) { if(isize+1||i0||size==maxsize)return error。 if(i==size+1) { list[i1]=item。 size++。 return ok。 } int j。 for(j=size。ji1。j) { list[j]=list[j1]。 } list[j]=item。 size++。 return ok。 } //刪除函數(shù) int SeqList::list_del(int i) { if(isize||i0||size==0)return error。 int j。 for(j=i1。jsize1。j++) { list[j]=list[j+1]。 } size。 return ok。 } //返回值函數(shù) int SeqList::list_get(int i) { if(i=0||isize)return error。 return list[i1]。 } //輸出函數(shù) void SeqList::list_display() { int j。 for(j=0。jsize。j++) { coutlist[j] 。 } coutendl。 } int main() { int n,m,j,NUM。 SeqList L1,L2,L3。 cinn。 for(j=0。jn。j++) { cinNUM。 (j+1,NUM)。 } cinm。 for(j=0。jm。j++) { cinNUM。
點(diǎn)擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1