[자료구조실습] Huffman algorithm
*동*
다운로드
장바구니
소개글
자료구조 상당히 어렵죠...열심히 하면 다 됩니다..전 아무것도 모르는 상태에서...
열심히 하다보니 이걸 짜게 되더군요...ㅋ
쉽게 프로그래밍 했습니다...저같은 분들을 위해서..
많은 도움이 되었으면..싶네요...^^
목차
자료구조(DS) 실습 - Huffman algorithm1. Huffman algorithm 소스파일
2. Huffman algorithm 예제 input 파일
3. 주석 완벽 처리
4. 템플릿 소스
5. 트리
6. 각종 자료구조 이용한 huffman 알고리즘
7. input.txt(예제 input 파일)
본문내용
////////////////////////////////////////////////////////////////////////////////////////// //
// # Data Structure Lab Report (Assignment #2 : Huffman algorithm) //
// //
// # File Name : huffman.cpp //
// # Date : 2002/11/8 //
// # Compiler : g++ //
// //
// # Author : Cin Dong Hoon //
// # Student ID : 98102083 //
// //
// # ver : 1.0 //
// //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Header File 선언부 Header file //
////////////////////////////////////////////////////////////////////////////////////////
#include< iostream>
#include< fstream>
#include< string>
#include< math.h>
using namespace std;
ofstream fout("output.txt",ios::out); //output file stream
////////////////////////////////////////////////////////////////////////////////////////
// Node class 선언부 Node class ////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
template <class Type>
class Node{
private:
int freq; //문자열에서 알파벳의 빈도수(frequncy)
Type* alpha; //노드의 문자열 정보
Node<Type> *left, *right, *parent; //노드의 leftchild node, rightchild node, parent node
public:
Node(){left=0; right=0; parent=0; freq=0;}; //생성자
~Node(){}; //소멸자
void set_f(int); //노드에 문자의 빈도수(freq)저장
int get_f(); //노드의 freq 반환
void set_a(Type*); //노드에 문자(alpha) 정<font color=aaaaff>..</font>
참고 자료
없음이 자료와 함께 구매한 자료
- Huffman code 프로그램, 허프만코드 프로그램 11페이지
- c++ 허프만 트리 구현 0페이지
- C언어를 이용한 Huffman coding 15페이지
- 허프만 알고리즘 13페이지
- [자료구조] dijstra 알고리즘/가중치 그래프/C++/주석有 6페이지