stack impl, both linked list and array.