国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

怎樣編輯網(wǎng)頁網(wǎng)站關(guān)鍵詞排名優(yōu)化

怎樣編輯網(wǎng)頁,網(wǎng)站關(guān)鍵詞排名優(yōu)化,合肥網(wǎng)站建設(shè)優(yōu)化學(xué)習(xí),wordpress安裝 萬網(wǎng)數(shù)據(jù)結(jié)構(gòu)——隊(duì)列的實(shí)現(xiàn)(單鏈表) 一.隊(duì)列1.1隊(duì)列的概念及結(jié)構(gòu) 二.隊(duì)列的實(shí)現(xiàn)2.1 頭文件的實(shí)現(xiàn)——(Queue.h)2.2 源文件的實(shí)現(xiàn)—— (Queue.c)2.3 源文件的實(shí)現(xiàn)—— (test.c) 三.隊(duì)列的…

數(shù)據(jù)結(jié)構(gòu)——隊(duì)列的實(shí)現(xiàn)(單鏈表)

  • 一.隊(duì)列
    • 1.1隊(duì)列的概念及結(jié)構(gòu)
  • 二.隊(duì)列的實(shí)現(xiàn)
    • 2.1 頭文件的實(shí)現(xiàn)——(Queue.h)
    • 2.2 源文件的實(shí)現(xiàn)—— (Queue.c)
    • 2.3 源文件的實(shí)現(xiàn)—— (test.c)
  • 三.隊(duì)列的實(shí)際數(shù)據(jù)測(cè)試展示
    • 3.1正常出隊(duì)列入隊(duì)列
    • 3.2 入隊(duì)列的同時(shí)存在出隊(duì)列

一.隊(duì)列

1.1隊(duì)列的概念及結(jié)構(gòu)

在這里插入圖片描述

二.隊(duì)列的實(shí)現(xiàn)

2.1 頭文件的實(shí)現(xiàn)——(Queue.h)

Queue.h
#pragma once#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<assert.h>typedef int QDataType;
typedef struct QueueNode
{QDataType val;struct QueueNode* next;
}QNode;typedef struct Queue
{QNode* phead;QNode* ptail;int size;
}Queue;//初始化/銷毀
void QueueInit(Queue* pq);
void QueueDestroy(Queue* pq);//出隊(duì)/入隊(duì)
void QueuePush(Queue* pq, QDataType x);
void QueuePop(Queue* pq);
//獲取隊(duì)頭元素/隊(duì)尾元素
QDataType QueueFront(Queue* pq);
QDataType QueueBack(Queue* pq);
//判空/統(tǒng)計(jì)隊(duì)列元素個(gè)數(shù)
bool QueueEmpty(Queue* pq);
int QueueSize(Queue* pq);

2.2 源文件的實(shí)現(xiàn)—— (Queue.c)

Queue.c
#include"Queue.h"//初始化/銷毀
void QueueInit(Queue* pq)
{assert(pq);pq->phead = pq->ptail = NULL;pq->size = 0;
}
void QueueDestroy(Queue* pq)
{assert(pq);QNode* cur = pq->phead;while (cur){QNode* Next = cur->next;free(cur);cur = Next;}pq->phead = pq->ptail = NULL;pq->size = 0;
}//隊(duì)尾入隊(duì)/隊(duì)首出隊(duì)
void QueuePush(Queue* pq, QDataType x)
{assert(pq);QNode* Newnode = (QNode*)malloc(sizeof(QNode));if (Newnode == NULL){perror("malloc fail");return;}Newnode->val = x;Newnode->next = NULL;if (pq->phead == NULL){pq->phead = pq->ptail = Newnode;}else{pq->ptail->next = Newnode;pq->ptail = pq->ptail->next;}pq->size++;
}
void QueuePop(Queue* pq)
{assert(pq);assert(pq->phead);QNode* del = pq->phead;pq->phead = pq->phead->next;free(del);del = NULL;if (pq->phead == NULL)pq->ptail = NULL;pq->size--;}//獲取隊(duì)頭元素/隊(duì)尾元素
QDataType QueueFront(Queue* pq)
{assert(pq);assert(pq->phead);return pq->phead->val;
}
QDataType QueueBack(Queue* pq)
{assert(pq);assert(pq->ptail);return pq->ptail->val;}
//判空/統(tǒng)計(jì)隊(duì)列元素個(gè)數(shù)
bool QueueEmpty(Queue* pq)
{assert(pq);return pq->phead == NULL;
}
int QueueSize(Queue* pq)
{assert(pq);return pq->size;
}

2.3 源文件的實(shí)現(xiàn)—— (test.c)

test.c
#include"Queue.h"int main()
{Queue S;QueueInit(&S);QueuePush(&S, 1);QueuePush(&S, 2);printf("%d ", QueueFront(&S));QueuePop(&S);QueuePush(&S, 3);QueuePush(&S, 4);printf("%d ", QueueFront(&S));QueuePop(&S);QueuePush(&S, 5);while (!QueueEmpty(&S)){printf("%d ", QueueFront(&S));QueuePop(&S);}QueueDestroy(&S);
}

三.隊(duì)列的實(shí)際數(shù)據(jù)測(cè)試展示

1.出入隊(duì)列的方式:隊(duì)尾進(jìn)入,對(duì)首出隊(duì)列。
2.出隊(duì)列和入隊(duì)列的關(guān)系是:一對(duì)一的。

3.1正常出隊(duì)列入隊(duì)列

在這里插入圖片描述

3.2 入隊(duì)列的同時(shí)存在出隊(duì)列

在這里插入圖片描述

http://aloenet.com.cn/news/36015.html

相關(guān)文章:

  • wordpress建站教程視頻百度指數(shù)需求圖譜
  • 類似于眾人幫的做任務(wù)賺傭金網(wǎng)站seo案例分析及解析
  • 給你一個(gè)網(wǎng)站你怎么做的嗎網(wǎng)盤網(wǎng)頁版
  • 深圳建設(shè)網(wǎng)站制作公司訊展網(wǎng)站優(yōu)化推廣
  • 網(wǎng)站制作的基本步驟診斷網(wǎng)站seo現(xiàn)狀的方法
  • 蕪湖建設(shè)工程質(zhì)量監(jiān)督站網(wǎng)站福建seo快速排名優(yōu)化
  • 網(wǎng)站建設(shè)用啥技術(shù)新聞?lì)^條 今天
  • 怎么下載wordpress內(nèi)置的主題廣州seo公司如何
  • 源代碼如何做網(wǎng)站百度移動(dòng)端點(diǎn)贊排名軟件
  • ps6做網(wǎng)站點(diǎn)哪里保存seo最新
  • 成都三合一網(wǎng)站建設(shè)推廣新產(chǎn)品最好的方法
  • 武漢哪里做網(wǎng)站好找個(gè)免費(fèi)的網(wǎng)站
  • 提供網(wǎng)站制作百度風(fēng)云排行榜官網(wǎng)
  • 網(wǎng)站建設(shè)公司該怎么銷售微信推廣方法
  • 上海企業(yè)招聘信息發(fā)布平臺(tái)長沙seo優(yōu)化推薦
  • 網(wǎng)站建設(shè)原因分析win7系統(tǒng)優(yōu)化軟件
  • 中國新聞社招聘2023年褲子seo關(guān)鍵詞
  • 中國最近軍事新聞視頻桂林網(wǎng)站優(yōu)化
  • 網(wǎng)站推廣解釋中國有幾個(gè)搜索引擎
  • 網(wǎng)站廣告輪播代碼運(yùn)營是做什么的
  • 邀請(qǐng)注冊(cè)推廣賺錢seo深圳優(yōu)化
  • 如何在記事本中做網(wǎng)站鏈接長沙自動(dòng)seo
  • 黃石建設(shè)信息網(wǎng)站國內(nèi)網(wǎng)絡(luò)銷售平臺(tái)有哪些
  • 公司網(wǎng)站建設(shè)開發(fā)濟(jì)南興田德潤優(yōu)惠嗎推廣平臺(tái)排行榜app
  • 行業(yè)網(wǎng)站建設(shè)費(fèi)用百度seo推廣軟件
  • 公司 做網(wǎng)站推廣信息發(fā)布平臺(tái)
  • 做網(wǎng)站是什么專業(yè)什么工作百度后臺(tái)推廣登錄
  • 做pc端網(wǎng)站要成本么廣告推廣軟件
  • wordpress loading優(yōu)化
  • wordpress手機(jī)版怎么注冊(cè)seo站