More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. pop method pulls the top element from the stack and then move the top to the next element whereas peek only get the top element but doesn't move the top.
Help us improve. Please let us know the company, where you were asked this question :