• 大小: 1KB
    文件类型: .cpp
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: C/C++
  • 标签: C++队列类  

资源简介

简单队列操作,vc++实现。队列类实现,小弟新手,大神莫黑

资源截图

代码片段和文件信息

#include 
using namespace std ;

struct Node{   
 int data ;    
 Node * next ;    
 Node(int d):next(NULL)
{data=d ;}
};

class Queue{
private :    
Node *head;
Node *tail;
public :    
Queue(){        
head = NULL ;        
tail = head ;    
}        
int Pop() {        
if(head == NULL)
return false;        
Node* p = head ;        
if(head->next == NULL)
tail = NULL ;        
head = head->next ;        
int data = p->data ;        
delete p ;        
return data ;    
}    
voi

评论

共有 条评论

相关资源