haffman

package
v0.0.0-...-6a45195 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2024 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Usles int

Functions

func Haffman2

func Haffman2(f string)

func HaffmanCompress

func HaffmanCompress()

func HaffmanDecode

func HaffmanDecode(b []byte, n *Node) []byte

func HaffmanDecode2

func HaffmanDecode2(byteArray []byte, n *Node2) string

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

func HaffmanEncode

func HaffmanEncode(b []byte) ([]byte, *Node)

type Node2

type Node2 struct {
	// contains filtered or unexported fields
}

Huffman Tree Node

func HaffmanEncode2

func HaffmanEncode2(s string) ([]byte, *Node2)

type PriorityQueue

type PriorityQueue []*Node

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type PriorityQueue2

type PriorityQueue2 []*Node2

A Min-Heap (priority queue) for the nodes

func (PriorityQueue2) Len

func (pq PriorityQueue2) Len() int

func (PriorityQueue2) Less

func (pq PriorityQueue2) Less(i, j int) bool

func (*PriorityQueue2) Pop

func (pq *PriorityQueue2) Pop() interface{}

func (*PriorityQueue2) Push

func (pq *PriorityQueue2) Push(x interface{})

func (PriorityQueue2) Swap

func (pq PriorityQueue2) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL