The wavelet tree holds S, all out-neighbourhoods concatenated; the bitvector B holds
the out-degrees in unary. Together they answer out- and in-neighbour queries symmetrically.
S, and the bitvector B.out-neighbour: select1(B,v) finds v's block, then read S inside it. in-neighbour: selectu(S,i) finds an edge into u, then B maps that S-position back to its source vertex. degrees are a gap in B (out) or a symbol count in S (in).