Skip to content
Permalink
f8f19a5b9a
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
49 lines (36 sloc) 1.01 KB
/* Copyright (C) 2023 Harry Clark - Student No. 12340530 */
/* DATE: 13/03/23 */
/* HUFFMAN CODE DEMONSTRATION */
/* JUST A LITTLE THING I WANTED TO MAKE FOR FUN AFTER WATCHING A
/* TOM SCOTT VIDEO ABOUT THE SUBJECT */
/* THESE ARE THE TYPES AND FUNCTIONALITY PERTAINING TO THIS ALGORITHM */
#ifndef HUFFMAN_TYPES
#define HUFFMAN_TYPES
/* SYSTEM INCLUDES */
#include <stdio.h>
/* NESTED INCLUDES */
#include "common.h"
/* CREATE THE NODES THAT THE EENCODER WILL BRANCH OFF */
/* THE IDEA IS TO DISCERN WHICH DIRECTION THE POINTER */
/* WILL GO ALONG THE TREE */
typedef struct NODE
{
typedef UNK_SIZE* FREQUENCY;
typedef U8* CHAR;
NODE* LEAF(FREQUENCY, CHAR);
NODE* INTERNAL_NODE(FREQUENCY, CHAR);
NODE* LEFT_PTR();
NODE* RIGHT_PTR();
};
typedef struct ENCODER : NODE
{
typedef U8* DATA[];
typedef UNK_SIZE* BITWISE_LENGTH;
};
typedef struct TREE
{
ENCODER* ENCODE(UNK_8* ENCODE_CHAR);
ENCODER* DECODE(UNK_8* DECODE_CHAR);
TREE* BUILD_TREE(void);
};
#endif