Design a stack whose capacity is not known in advance. After an array-based stack, implement it with a doubly linked list, and then without back pointers, keeping push, pop and peek at O(1).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.