0

An interviewer asked me yesterday how to implemented a singly linked list using 2 (two) stack objects while keeping the same time complexity of a singly linked list.

Do you have any idea how this could be done?

PS: I may have misunderstood the question in some way, so please tell me if you know about a 'classic' case that is somehow similar to this.

Hope the question was clear.

Cheers!

Mohamed B
  • 83
  • 1
  • 5

1 Answers1

0

I just found this similar question: How to implement a queue using two stacks?

I think I can answer my question based on the solution described in the top answer there.

Community
  • 1
  • 1
Mohamed B
  • 83
  • 1
  • 5