custom d-ary heap with cmp_fn_t