data structures implementation of stack and queue with an array