資源簡介
1.要求對文件進行Huffman編碼的算法,以及對一編碼文件進行解碼的算法
2.熟練掌握二叉樹的應用;具體要求如下:
最小冗余碼/哈夫曼碼

代碼片段和文件信息
//?huffman.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“huffman.h“
#include?“huffmanDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CHuffmanApp
BEGIN_MESSAGE_MAP(CHuffmanApp?CWinApp)
//{{AFX_MSG_MAP(CHuffmanApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CHuffmanApp?construction
CHuffmanApp::CHuffmanApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CHuffmanApp?object
CHuffmanApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CHuffmanApp?initialization
BOOL?CHuffmanApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CHuffmanDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????118829??2011-11-17?17:41??huffman_MFC\Debug\huffman.exe
?????文件?????321652??2011-11-17?17:41??huffman_MFC\Debug\huffman.ilk
?????文件??????16071??2011-11-14?22:32??huffman_MFC\Debug\huffman.obj
?????文件????5505248??2011-11-14?22:32??huffman_MFC\Debug\huffman.pch
?????文件?????361472??2011-11-17?17:41??huffman_MFC\Debug\huffman.pdb
?????文件???????3064??2011-11-17?17:41??huffman_MFC\Debug\huffman.res
?????文件??????45486??2011-11-17?17:37??huffman_MFC\Debug\huffmanDlg.obj
?????文件?????105763??2011-11-14?22:32??huffman_MFC\Debug\StdAfx.obj
?????文件?????205824??2012-11-10?21:26??huffman_MFC\Debug\vc60.idb
?????文件?????364544??2011-11-17?17:37??huffman_MFC\Debug\vc60.pdb
?????文件??????21920??2012-11-10?20:40??huffman_MFC\huffman.aps
?????文件???????1734??2012-11-10?21:26??huffman_MFC\huffman.clw
?????文件???????2077??2008-12-14?15:24??huffman_MFC\huffman.cpp
?????文件???????4240??2008-12-16?12:59??huffman_MFC\huffman.dsp
?????文件????????537??2008-12-14?16:00??huffman_MFC\huffman.dsw
?????文件???????1335??2008-12-14?15:24??huffman_MFC\huffman.h
?????文件?????132096??2012-11-10?21:26??huffman_MFC\huffman.ncb
?????文件??????50688??2012-11-10?21:26??huffman_MFC\huffman.opt
?????文件????????669??2011-11-17?17:41??huffman_MFC\huffman.plg
?????文件???????6541??2011-11-17?17:40??huffman_MFC\huffman.rc
?????文件???????7255??2011-11-14?22:29??huffman_MFC\huffmanDlg.cpp
?????文件???????1657??2008-12-16?16:48??huffman_MFC\huffmanDlg.h
?????文件???????2170??2008-12-25?21:27??huffman_MFC\huffmanHead.h
?????文件???????3597??2008-12-14?15:24??huffman_MFC\ReadMe.txt
?????文件???????1078??2008-12-14?15:24??huffman_MFC\res\huffman.ico
?????文件????????399??2008-12-14?15:24??huffman_MFC\res\huffman.rc2
?????文件???????1053??2008-12-14?15:44??huffman_MFC\resource.h
?????文件????????209??2008-12-14?15:24??huffman_MFC\Stdafx.cpp
?????文件???????1054??2008-12-14?15:24??huffman_MFC\Stdafx.h
?????文件????????157??2008-12-25?19:35??huffman_MFC\新建?文本文檔.txt
............此處省略6個文件信息
- 上一篇:MFC簡單通訊錄制作
- 下一篇:二叉樹的前序中序后序遍歷MFC
評論
共有 條評論