Help for this page

Select Code to Download


  1. or download this
    sub build_inversion_list_and_index {
      my @invlist;
    ...
      shift @index;
      return \@invlist, \@index;
    }
    
  2. or download this
    sub get_nth_char($i, $invlist, $index) {
      return undef if $i >= $index[-1];
    ...
        else { return $invlist[$mid*2] + ($i - ($mid > 0? $index[$mid-1] :
    + 0)) }
      }
    }