Implementation of an array based stack