[알고리즘]huffman algorithm 을 이용한 파일 압축과 해제 encoding & decoding
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
해당 자료는 7페이지 까지만 미리보기를 제공합니다.
7페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[알고리즘]huffman algorithm 을 이용한 파일 압축과 해제 encoding & decoding에 대한 보고서 자료입니다.

본문내용

void main(void)
{
FILE *src, *src2, *src3;
int type;

printf("Press the Number key < 1 or 2 > \n");
printf("1 : Encoding\n2 : Decoding\n");

scanf("%d", &type);

/* Encoding */
if (type == 1)
{
if ((src = fopen("hw2_2_orig_doc.txt", "rb")) == NULL)
{
printf("\n Error. That File can not Found.");
exit(1);
}
Huffman_Comp(src);

printf("\nCongratulation! File compressed.\n");
printf("Created 3 files.\n\n");
printf("(1)hw2_2_encoded.bin\n(2)hw2_2_codeword.txt\n(3)hw2_2_bin_tree.txt\n\n");

fclose(src);
}

/*Decoding*/
else if (type == 2)
{
if ((src2 = fopen("hw2_2_encoded.bin", "rb")) == NULL)
{
printf("\n Error. That File can not Found.");
exit(1);
}

if ((src3 = fopen("hw2_2_bin_tree.txt", "r")) == NULL)
{
printf("\n Error. That File can not Found.");
exit(1);
}

Huffman_Decomp(src2, src3);
printf("\nCongratulation! File decompressed & created.\n");
printf("Created 1 file.\n\n(1)hw2_2_decoded.txt\n\n");
fclose(src2);
fclose(src3);
}

else
printf("Please try Again.");

}

키워드

  • 가격2,000
  • 페이지수20페이지
  • 등록일2004.11.15
  • 저작시기2004.11
  • 파일형식압축파일(zip)
  • 자료번호#273071
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니