aboutsummaryrefslogtreecommitdiff
path: root/src/heap.cpp (follow)
AgeCommit message (Collapse)Author
2010-02-13Added and updated the license info in all the source files, they still saidMike Buland
copyright 2007-2008.
2010-01-07A bunch of things weren't including their own files in quite the correct way...Mike Buland
2008-02-19I believe this will do the trick. The Bu::Heap class now uses the appropriateMike Buland
allocators for all work, every data type used in a Bu::Heap must support the equals operator and <= or >=, or you need to write your own comparison functor. The heap works as both a min-heap and max-heap, just change out the functor used for camparison, kinda' cool. The print function I'll leave in for a little while, but not in the long run, it just prints a dot graph to stdout. Next up, the Ito version.
2008-02-19Bu::Heap is a real class, it works great, except it doesn't grow right now.Mike Buland
I'm thinking the heap should add one layer to the binary tree each time it grows, which means double+1 each time. The Bu::ItoHeap will be implemented as soon as the rest of Bu::Heap is done. Also, I finally added bu/util.h which is mainly handy template functions like Bu::swap, Bu::min, Bu::max, and Bu::mid. A few more may be added.