← Microsoft questions

Sort Stack with Temporary Stack

Filed under Microsoft

Write a function to sort a stack in ascending order such that the smallest items are on the top, using only one additional temporary stack and no other data structures.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.