vedantslab / Hacktoberfest_2021

This Repository Aims To Help Beginners with their first successful pull request and Know How to do open source contributions Also For Intermediate and Advance level contributors as well.
Apache License 2.0
0 stars 8 forks source link

Implement a min Stack #19

Open vedantslab opened 2 years ago

vedantslab commented 2 years ago

Fork and go to Hactoberfest_2021/Beginner Create a minStack that has following functions. -push(data): it pushes val on top of stack -pop(): it removes top most element from stack -top(): it returns top most element of stack (doesn't remove it) -minVal(): it returns the minimum value of the stack. Write a code that performs all four functions in BigOh(1) time complexity.

Ayan1089 commented 2 years ago

Can you check this PR? #20 @vedantslab