linked stack and sequential stack implementation