added tail for stack arraylist and linkedlist