compute reverse index in vtree