0 votes 0 votes Consider a stack is implemented using an array. What is worst case time complexity of push operation? A) O(n) B) O(log n) C) O(n log n) D) O(1) DS stack data-structures + – srestha asked Jan 13, 2017 srestha 5.4k views answer comment Share Follow See all 18 Comments See all 18 18 Comments reply Show 15 previous comments srestha commented Jan 13, 2017 reply Follow Share like stack how array do deletion in O(1) time? means in array we have to go from 1st element,rt? 0 votes 0 votes Rahul Jain25 commented Jan 13, 2017 reply Follow Share I will use a variable top, whenever i will insert i will insert at array[top], increment top and whenver delete i will delte array[top] , bcoz i dont need to remember how many elements are there in stack , this top variable will be doing it. Insert delete both in O(1) 0 votes 0 votes Hradesh patel commented Jan 13, 2017 reply Follow Share i think here O(n) is correct 0 votes 0 votes Please log in or register to add a comment.