GATE CSE
First time here? Checkout the FAQ!
x
0 votes
81 views
Is any operations in stack array implementation is linear time complexity?

If there what is operation and explain abt that?
asked in DS by Junior (699 points)  
recategorized by | 81 views

1 Answer

0 votes

Basic Operations of stack -:push and Pop takes constant time $\Omega \left ( 1 \right )$,But searching an element will take $O\left ( n \right )$ as in the worst case you may have to pop 'n' element to get the key if the key is present at the bottom of stack.

Note -:Searching is not basic operation of stack.

answered by Boss (8.1k points)  


Top Users Mar 2017
  1. rude

    5128 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2732 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1422 Points

  8. Akriti sood

    1386 Points

  9. Bikram

    1350 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,535 questions
26,867 answers
61,198 comments
23,218 users