⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queue.h

📁 计算所汉语词法分析系统ICTCLAS介绍 词是最小的能够独立活动的有意义的语言成分。 但汉语是以字为基本的书写单位
💻 H
字号:
/****************************************************************************
 *
 * Copyright (c) 2000, 2001 
 *     Software Research Lab.
 *     Institute of Computing Tech.
 *     Chinese Academy of Sciences
 *     All rights reserved.
 *
 * This file is the confidential and proprietary property of 
 * Institute of Computing Tech. and the posession or use of this file requires 
 * a written license from the author.
 *
 * Abstract:
 *           Queue 
 * Author: Kevin Chang (zhanghp@software.ict.ac.cn)
 *
 * Notes:
 *                
 * 
 ****************************************************************************/
// Queue.h: interface for the CQueue class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_QUEUE_H__382C7319_66D8_4041_ABA2_EE25B9D15D9C__INCLUDED_)
#define AFX_QUEUE_H__382C7319_66D8_4041_ABA2_EE25B9D15D9C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DynamicArray.h"

struct tagQueueElem{
    unsigned int nParent;//the weight
	unsigned int nIndex;//number of index in the parent node
	ELEMENT_TYPE eWeight;//the weight of last path
    struct tagQueueElem *next;
};
typedef struct tagQueueElem QUEUE_ELEMENT,*PQUEUE_ELEMENT;

class CQueue  
{
public:
	bool IsSingle();
	bool IsEmpty(bool bBrowsed=false);
	int Push(unsigned int nValue=0,//The value for parent node
			 unsigned int nIndex=0,//number of index in the parent node
             ELEMENT_TYPE eWeight=0//the weight of last path 
			 );
	int Pop( unsigned int *npValue,//The value for node
			 unsigned int *npIndex,//number of index in the parent node
		     ELEMENT_TYPE *epWeight=0,//the weight of last path 
			 bool  bModify=true,//false: not modify the data
			 bool bFirstGet=true//first get data,just for browse 
		   );
	
	CQueue();
	virtual ~CQueue();
private:
	PQUEUE_ELEMENT m_pHead;//The chain sort according the weight of shortest path
	PQUEUE_ELEMENT m_pLastAccess;//The node last accessed
};

#endif // !defined(AFX_QUEUE_H__382C7319_66D8_4041_ABA2_EE25B9D15D9C__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -