Question d’entretien chez Meta

Write a list class where the only data structure available is a stack

Réponses aux questions d'entretien

Utilisateur anonyme

20 avr. 2011

Use two stacks back to back. List head = top of left stack; List tail = top of right stack. Copy elements over from right to left when left is empty, since we always want access to list head.

Utilisateur anonyme

9 nov. 2017

How do we implement get(i) using 2 stacks?