minleftlisttree.h

来自「插入和删除最小元素操作」· C头文件 代码 · 共 42 行

H
42
字号
// MinLeftistTree.h: interface for the MinLeftistTree class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MINLEFTISTTREE_H__44BC6CDF_1A26_4E4B_9D14_6A73D3F3D038__INCLUDED_)
#define AFX_MINLEFTISTTREE_H__44BC6CDF_1A26_4E4B_9D14_6A73D3F3D038__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

struct element
{
	int key;
};

class MinLeftlistTree;
class LeftlistNode  
{
public:
	element data;
	LeftlistNode *LeftChild, *RightChild;
	int shortest;

};

class MinLeftlistTree
{
public:
	MinLeftlistTree(LeftlistNode* init = 0):root(init){};

	void Insert( const element& );
	element* Delete( element& );
	void MinCombine( MinLeftlistTree* );
private:
	LeftlistNode* MinUnion(LeftlistNode *,LeftlistNode *);
	LeftlistNode* root;

};

#endif // !defined(AFX_MINLEFTISTTREE_H__44BC6CDF_1A26_4E4B_9D14_6A73D3F3D038__INCLUDED_)

⌨️ 快捷键说明

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