code: public int getMaxIdx() {
          int max = Integer.MIN_VALUE;
          for (int i=0; i<this.top; i++) {
              if (idx[i] > max) {
                  max = idx[i];
              }
          }
          return max;
      }
docs: TODO: Move this to prim.