Skip to content
/ jebe Public

Implementing a couple of algorithms in Go for fun

License

Notifications You must be signed in to change notification settings

PuppyKhan/jebe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jebe

Implementing a couple of algorithms in Go for fun

Each acts upon type Item interface{} for value and needs custom defined comparison functions so they work for any data, not just int.

Packages

Heap

HeapSort: Sort underlying array in place using HeapSort algorithm

Can be used as a max, min or custom priority heap by setting the comparison with a custom PrioritizeHeapItem(), with Push/Pop aliases

  • Push() could dynamically grow heap, thus needing a copy operation so original may not be sorted

Satisfies sort.Interface

import "github.com/PuppyKhan/jebe/heap"

Follows pseudocode from "Introduction to Algorithms" by Cormen, Leiserson, Rivest, Stein

BST

Binary Search Tree, order can be custom defined.

Both recursive and nonrecursive methods given as an excercise, use the nonrecursive in practice. Use:

  • Insert() instead of InsertRecursive()
  • InOrderTreeWalk() instead of InOrderTreeWalkRecursive()
  • Search() instead of SearchRecursive()
import "github.com/PuppyKhan/jebe/bst"

Follows pseudocode from "Introduction to Algorithms" by Cormen, Leiserson, Rivest, Stein

AVL

AVL Sort using balanced Binary Search Tree

Supports sorting, traversal, and priority queue functionality, on min and max

import "github.com/PuppyKhan/jebe/avl"

Follows:

Jebe meaning

Jebe is the name of one of Chinggis Khaan's greatest warriors, whose name means "weapon" - though probably something more specific like a particular type of arrowhead.

This offers a wonderful tagline:

These are a good collection of arrows to have in your quiver.

Author

Luigi Kapaj

About

Implementing a couple of algorithms in Go for fun

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages