Special Stack | Stack | C++ Solution
Special Stack, is a Stack related problem and in this post we will see how we can solve this challenge in C++
Special stack ADT with added features like: getMiddle():returns middle element deleteMiddle():as the name suggests All these in O(1) see count of elements .If the count becomes odd then move the middle pointer otherwise on pop if the count becomes even then move the middle backwards
Please check the main.cpp snippet for the solution.
This solution originally posted at: Github by @susantabiswas
Comments
Leave a comment
You are not LoggedIn but you can comment as an anonymous user which requires manual approval. For better experience please Login.