stack & queue implemented without linked list abstraction