Saltar al contenido principal

3 documentos etiquetados con "stack"

Ver Todas las Etiquetas

Add Two Numbers II

Given two linked lists that represent two numbers, return the sum of the numbers also represented as a list.

Implement Stack Using Queue

Design a class to implement a stack using only a single queue. Your class, QueueStack, should support the following stack methods: push() (adding an item), pop() (removing an item), peek() (returning the top value without removing it), and empty() (whether or not the stack is empty).