1 votes 1 votes What is difference between $pop\left ( \right )$,$empty Stack\left ( \right )$,$delete Stack\left ( \right )$? Can all be performed in $O\left ( 1 \right )$ time? Programming in C stack data-structures + – srestha asked Jun 22, 2018 srestha 457 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes in practise, we use a single stack but there are many stacks linked together in single linked list manner.Every stack will have same property as the simple stack. pop()-It means deleting and returning the top element of the stack. time complexity O(1) deleteStack()-it is used to delete the particular stack from the list. If from beginning time complexity O(1) emptyStack()- it is used to create a empty stack.If insert at beginning in that case time complexity O(1) https://books.google.co.in/books?id=mgYiBAAAQBAJ&pg=PT143&lpg=PT143&dq=deletestack()&source=bl&ots=OGrC4UPlmr&sig=xMK_kEUn8asHGq89FGCs2xk8p40&hl=en&sa=X&ved=0ahUKEwi29r_y4efbAhWXbysKHS58BigQ6AEIWjAE#v=onepage&q=emptystack()&f=false Anil Ji answered Jun 22, 2018 Anil Ji comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes if we use array then all these operation takes place in O(1) time arun yadav answered Sep 25, 2020 arun yadav comment Share Follow See all 0 reply Please log in or register to add a comment.