MinHeap.h
上传用户:yli86818
上传日期:2014-07-15
资源大小:273k
文件大小:1k
- // MinHeap.h: interface for the CMinHeap class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_MINHEAP_H__60D192E5_ED12_4195_AB56_B0D183787C06__INCLUDED_)
- #define AFX_MINHEAP_H__60D192E5_ED12_4195_AB56_B0D183787C06__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <vector>
- #include "MatchInfo.h"
- class CMinHeap
- {
- public:
- CMinHeap();
- virtual ~CMinHeap();
- void insert (CMatchInfo info);
- CMatchInfo deleteMin ();
- int getSize ();
- double get2ndMin();
- private:
- std::vector<CMatchInfo> m_infos;
- void percolateup (int i);
- void percolatedown (int i);
- };
- #endif // !defined(AFX_MINHEAP_H__60D192E5_ED12_4195_AB56_B0D183787C06__INCLUDED_)