Skip to content

Instantly share code, notes, and snippets.

// C Program for Efficient Huffman Coding for Sorted input
// http://www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding-set-2/
#include <stdio.h>
#include <stdlib.h>
// This constant can be avoided by explicitly calculating height of Huffman Tree
#define MAX_TREE_HT 100
/* Modification -----------*/
// Hencoding.cpp : Defines the entry point for the console application.
// SLAWOMIR MLYNAROWICZ - 12100888
// RICHARD DUNN - 12100858
// 1BCT 2014, CT103, NUIG
//#include "stdafx.h"
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
char *array[5]; // Array of tokens
void readCommand(char *commandString){ // A utility function used for splitting given command on parts - string token, use of space as a divider
int i = 0; char *token;
// Array[i] holds the following
array[0] = NULL; // Operation (encode. decode)
array[1] = NULL; // Target (file, console)
array[2] = NULL; // Input file path
array[3] = NULL; // Optional operation ('write' to the file)
array[4] = NULL; // Output file path