shiftn method
adds the elem to the end of this
if n is given the first element is popped,
if the list is longer than n
Implementation
void shiftn(T elem, int len) => (length >= len) ? shift(elem) : add(elem);
adds the elem to the end of this
if n is given the first element is popped,
if the list is longer than n
void shiftn(T elem, int len) => (length >= len) ? shift(elem) : add(elem);