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

正文內(nèi)容

數(shù)據(jù)結構課程設計-猴子選大王課程設計(編輯修改稿)

2024-10-07 21:00 本頁面
 

【文章內(nèi)容簡介】 ct node { int data。 struct node *next。 猴 子選大王 5 }linklist。 主函數(shù)的實現(xiàn)調(diào)用操作: 采用循環(huán)鏈表來實現(xiàn),可參考課本。 int main() { int i, n, k, m, total。 linklist *head, *p, *s, *q。 /* 讀入問題條件 */ printf(Please enter the number of monkeys:)。 scanf(%d, amp。n)。 printf(Please enter from the monkeys began to count off the first of several:)。 scanf(%d, amp。k)。 printf(Please enter the number out:)。 scanf(%d, amp。m)。 /* 創(chuàng)建循環(huán)鏈表,頭節(jié)點也存信息 */ head = (linklist*) malloc(sizeof(linklist))。 猴 子選大王 6 p = head。 pdata = 1。 pnext = p。 /* 初始化循環(huán)鏈表 */ for (i = 2。 i = n。 i++) { s = (linklist*) malloc(sizeof(linklist))。 sdata = i。 snext = pnext。 pnext = s。 p = pnext。 } /* 找到第 k 個節(jié)點 */ p = head。 for (i = 1。 i k。 i++) 猴 子選大王 7 { p = pnext。 } /* 保存節(jié)點總數(shù) */ total = n。 printf(\nOut of sequence:)。 q = head。 /* 只剩一個節(jié)點時停止循環(huán) */ while (total != 1) { /* 報數(shù)過程, p 指向要刪除的節(jié)點 */ for (i = 1。 i m。 i++) { p = pnext。 } 猴 子選大王 8 /* 打印要刪除的節(jié)點序號 */ printf([%d] , pdata)。 /* q 指向 p 節(jié)點的前驅(qū) */ while (qnext != p) { q = qnext。 } /* 刪除 p 節(jié)點 */ qnext = pnext。 /* 保存被刪除節(jié)點指針 */ s = p。 /* p 指向被刪除節(jié)點的后繼 */ p = pnext。 /* 釋放被刪除的節(jié)點 */ free(s)
點擊復制文檔內(nèi)容
法律信息相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1