docs: public IntegerDataStore getPositions() {
      if(positions != null) {
        return positions; // Return cached.
      }
      final ArrayDBIDs order = topologicalSort();
      WritableIntegerDataStore siz = computeSubtreeSizes(order);
      WritableIntegerDataStore pos = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_DB, -1);
      WritableIntegerDataStore ins = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, -1);
  
      int defins = 0; // Next root insertion position.
      DBIDVar v1 = DBIDUtil.newVar();
      // Place elements based on their successor
      for(DBIDArrayIter it = order.iter().seek(order.size() - 1); it.valid(); it.retract()) {
        final int size = siz.intValue(it);
        parent.assignVar(it, v1); // v1 = parent
        final int ipos = ins.intValue(v1); // Position of parent
        if(ipos < 0 || DBIDUtil.equal(it, v1)) {
          // Root: use interval [defins; defins + size]
          ins.putInt(it, defins);
          pos.putInt(it, defins + size - 1);
          defins += size;
          continue;
        }
        // Insertion position of parent = leftmost
        pos.putInt(it, ipos + size - 1);
        ins.putInt(it, ipos);
        ins.increment(v1, size);
      }
      siz.destroy();
      ins.destroy();
      return positions = pos;
    }