GATE CSE
First time here? Checkout the FAQ!
x
0 votes
76 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 (679 points)  
recategorized by | 76 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 (8k points)  
Top Users Jan 2017
  1. Debashish Deka

    8126 Points

  2. sudsho

    5042 Points

  3. Habibkhan

    4706 Points

  4. Vijay Thakur

    4458 Points

  5. Bikram

    4348 Points

  6. saurabh rai

    4212 Points

  7. Arjun

    4010 Points

  8. santhoshdevulapally

    3722 Points

  9. GateSet

    3292 Points

  10. Sushant Gokhale

    3286 Points

Monthly Topper: Rs. 500 gift card

19,122 questions
24,033 answers
52,725 comments
20,276 users