How To Sort A Stack

The LIFO property of a stack makes it difficult to sort on the fly. To solve this question, we are going to create another stack (temp) and #sort the elements in this new #stack relative to a pivot value. Happy Coding! TIMESTAMPS -------------------------------------------------------------------------------------------------------- Intro: 00:00 Illustration: 00:25 Complexity analysis: 07:10 Code: 07:46 QUESTION LINKS --------------------------------------------------------------------------------------------------------- Difficulty: Medium Source Code: https://github.com/MichaelVandi/Codin... Problem Link: Cracking The Coding Interview: Stacks and Queues Solutions FIND ME HERE -------------------------------------------------------------------------------------------------------- Website: https://mvandi.com Instagram:   / mike_ehl_   Twitter:   / michael_vandi   Github: https://github.com/MichaelVandi/ Evalu8 (Side project): https://evalu8.xyz