shift method

void shift(
  1. T elem
)

moves all elements of a list on index to the left and ads a new element to the end of a list

Implementation

void shift(T elem) {
  for (int i = 0; i < length - 1; i++) {
    this[i] = this[i + 1];
  }
  this[length - 1] = elem;
}