亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
  • 很易懂
    查看全部
  • 續-》 bool MyQueue::DeQueue(int &element) { if(QueueEmpty()) { return false; } element = m_pQueue[m_iHead]; m_iHead++; m_iQueueLen--; m_iHead = m_iHead%m_iQueueCapacity; return true; } void MyQueue::QueueTraverse() { for(int i = m_iHead;i<m_iQueueLen + m_iHead;i++) { cout<<m_pQueue[i%m_iQueueCapacity]<<endl; } }
    查看全部
    1 采集 收起 來源:環形隊列檢測

    2018-03-22

  • #include "MyQueue.h" #include <iostream> using namespace std; MyQueue::MyQueue(int queueCapacity) { m_iQueueCapacity = queueCapacity; m_iHead = 0; m_iTail = 0; m_iQueueLen = 0; m_pQueue = new int[m_iQueueCapacity]; } MyQueue::~MyQueue() { delete []m_pQueue; m_pQueue = NULL; } void MyQueue::ClearQueue() { m_iHead = 0; m_iTail = 0; m_iQueueLen = 0; } bool MyQueue::QueueEmpty() const { if(m_iQueueLen == 0) { return true; } else { return false; } } int MyQueue::QueueLength() const { return m_iQueueLen; } bool MyQueue::QueueFull() const { if(m_iQueueLen ==m_iQueueCapacity) { return true; } return false; } bool MyQueue::EnQueue(int element) { if(QueueFull()) { return false; } else { m_pQueue[m_iTail] = element; m_iTail++; m_iTail = m_iTail%m_iQueueCapacity; m_iQueueLen++; return true; } } 續-》
    查看全部
    1 采集 收起 來源:環形隊列檢測

    2018-03-22

  • #ifndef MYQUEUE_H #define MYQUEUE_H class MyQueue { public: MyQueue(int queueCapacity); //創建隊列 virtual ~MyQueue(); //銷毀隊列 void ClearQueue(); //清空隊列 bool QueueEmpty() const; //判空隊列 int QueueLength() const; //隊列長度 bool QueueFull() const; bool EnQueue(int element); //新元素入隊 bool DeQueue(int &element); //首元素出隊 void QueueTraverse(); //遍歷隊列 private: int *m_pQueue; //隊列數組指針 int m_iQueueLen; //隊列元素個數 int m_iQueueCapacity; //隊列數組容量 int m_iHead; int m_iTail; }; #endif
    查看全部
    1 采集 收起 來源:環形隊列檢測

    2018-03-22

  • //2016年10月22日18:14:30學習數據結構隊列篇 #include <iostream> #include <stdlib.h> #include "MyQueue.h" using namespace std; int main(void) { MyQueue *p = new MyQueue(4); p->EnQueue(10); p->EnQueue(12); p->EnQueue(16); p->EnQueue(18); p->QueueTraverse(); //遍歷 // 出隊 int e = 0; p->DeQueue(e); cout<<"----------"<<endl; cout<< e<<endl; //打印出隊元素 //清空隊列 p->ClearQueue(); p->QueueTraverse(); cout<<"----------"<<endl; //重新插入元素 p->EnQueue(20); p->EnQueue(30); p->QueueTraverse(); delete p; p = NULL; system("pause"); return 0; }
    查看全部
    0 采集 收起 來源:環形隊列檢測

    2018-03-22

  • 隊列常用功能
    查看全部
  • 隊列分為普通隊列與環形隊列,環形隊列更省空間。
    查看全部
    0 采集 收起 來源:隊列

    2016-10-21

  • 數據結構指數據的集合和數據之間的關系
    查看全部
    0 采集 收起 來源:課程簡介

    2016-10-21

  • 判斷語句。可以用 return +判斷語句+?+ture :faulse
    查看全部
  • 數據結構
    查看全部
    0 采集 收起 來源:隊列

    2016-10-13

  • 普通隊列要么效率低,要么浪費空間
    查看全部
    0 采集 收起 來源:隊列

    2016-10-13

  • 隊列要點
    查看全部
  • 惺惺惜惺惺
    查看全部
  • x'x'x'x'x'x'x
    查看全部
  • 喜喜喜喜喜喜喜喜
    查看全部

舉報

0/150
提交
取消
課程須知
本課程是程序世界中的核心課程 由于本門課程是以C++為編碼實現的,所以需要大家熟練掌握C++語言基礎語法。
老師告訴你能學到什么?
1、什么是數據結構、什么是隊列以及隊列的實現原理 2、如何設計隊列的類,如何完善類的設計 3、如何實現隊列的相關函數 4、如何檢驗代碼的正確性,如何完善代碼 5、如何與實際相結合,利用數據結構解決實際問題

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!