Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
clarkh9 committed Mar 13, 2023
1 parent bd21f25 commit a41fe79404f257c57986f19e429450c3fc417876
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
@@ -0,0 +1,49 @@
/* 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 ALL OF THE COMMON DATA TYPES ASSOCIATED WITH THIS PROJECT */

#ifndef COMMON_TYPES
#define COMMON_TYPES

#include <string>
#include <cstdint>
#include <Windows.h>

#ifndef UNSIGNED_TYPES
#define UNSIGNED_TYPES

typedef uint8_t U8;
typedef uint16_t U16;
typedef uint32_t U32;
typedef uint64_t U64;
typedef size_t UNK_SIZE;

#endif

#ifndef SIGNED_TYPES
#define SIGNED_TYPES

typedef int8_t S8;
typedef int16_t S16;
typedef int32_t S32;
typedef int64_t S64;

#endif

#ifndef UNKNOWN_TYPES
#define UNKNOWN_TYPES

typedef unsigned char UNK_8;
typedef unsigned short UNK_16;
typedef unsigned int UNK_32;
typedef unsigned long UNK_64;
typedef size_t UNK_SIZE;

#endif

#endif
@@ -0,0 +1,45 @@
/* 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"

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
Empty file.

0 comments on commit a41fe79

Please sign in to comment.