dridk/blog

Off by one in reverseBwt(bw) ?

rodv92 opened this issue · 0 comments

rodv92 commented

Shouldn't it be rowi = first[c][0] + ranks[rowi] + 1 ?

in :
def reverseBwt(bw):
ranks, tots = rankBwt(bw)
first = firstCol(tots)
rowi = 0
t = "$"
while bw[rowi] != '$':
c = bw[rowi]
t = c + t
rowi = first[c][0] + ranks[rowi]
return t
`