I´m having a hard time implementing the swap function for a wavelet tree, which would be:
Given an index i, swap the elements at positions i and i + 1.
Can anyone point any references that would help?
I´m having a hard time implementing the swap function for a wavelet tree, which would be:
Given an index i, swap the elements at positions i and i + 1.
Can anyone point any references that would help?
Here is Code