hoffman tree: Add histogram function