Compact Fenwick trees for dynamic ranking and selection