GATE CSE
First time here? Checkout the FAQ!
x
0 votes
90 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 (719 points)  
recategorized by | 90 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.4k points)  


Top Users May 2017
  1. akash.dinkar12

    3338 Points

  2. pawan kumarln

    2108 Points

  3. Bikram

    1922 Points

  4. sh!va

    1682 Points

  5. Arjun

    1614 Points

  6. Devshree Dubey

    1272 Points

  7. Debashish Deka

    1208 Points

  8. Angkit

    1056 Points

  9. LeenSharma

    1018 Points

  10. Arnab Bhadra

    812 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 22 - 28
  1. Bikram

    1008 Points

  2. pawan kumarln

    734 Points

  3. Arnab Bhadra

    726 Points

  4. Arjun

    342 Points

  5. bharti

    328 Points


22,893 questions
29,196 answers
65,302 comments
27,695 users