kdn251 / interviews

Everything you need to know to get the job.
https://www.youtube.com/channel/UCKvwPt6BifPP54yzH99ff1g?view_as=subscriber
MIT License
62.76k stars 12.83k forks source link

Deque interface should be used instead of Stack class in sorting a stack #193

Open TanyaAgarwal28 opened 3 years ago

TanyaAgarwal28 commented 3 years ago

Hi Stack class is used in sorting a stack u should use Deque interface instead of it because Stack has no interface, so if you know you need Stack operations you end up committing to a specific concrete class, which isn't usually a good idea.So I had make a pull request to change it #192