replace abstract method

void replace(
  1. int index
)

Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element.

Implementation

void replace(int index);