-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
29 lines (15 loc) · 1.26 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
This is an implementation of Huffman encoding/decoding using a Binary Search Tree and Binary Min Heap.
- huffman.rb: Huffman class for encoding of files and byte streams, plus decoding of bit streams
- byte_node.rb: ByteNode class used to represent the BST; 'byte' field is non-nil for leaves
- heap_util.rb: HeapUtil module defining essential operations for heaps -- build_heap, add_to_heap, and remove_heap_min
- count_util.rb: CountUtil module for counting operations for algorithm analysis
- console_util.rb: ConsoleUtil module for helper methods to dump/print data to the console
- huffman_demo.rb: Sinatra HTTP actions for displaying Huffman results in a web application
- views/*.erb: HTML views corresponding to Sinatra HTTP actions for rendering web pages
- public/*: static files (e.g., CSS) referenced in web pages
- files/*.txt: test files used to test/verify Huffman encoding/decoding
- test.rb: script to enumerate test files and verify correct handling of Huffman encoding/decoding
- config.*: configuration files for running the huffman_demo.rb Sinatra application
Execution instructions:
- Use "thin" to execute the Sinatra demo application: thin start -C config.yml
- Use "irb" to access the console, using the following to test, for example: load 'test.rb'