Redirected
edited by
2,651 views
3 votes
3 votes

Consider the following statements:
S1: If stack is implemented as an array, all the operation push, pop, is_empty stack ( ), delete stack ( ) can be performed in constant time.
S2: If stack is implemented as a linked list, all the operations is_empty stack, delete stack ( ) can be performed in constant time.
S3: Stack and queue both can be implemented will the help of same data structure.
S4: Circular queues can be implemented with the help of the stack data structure.
Which of the following option is false?

edited by

5 Answers

0 votes
0 votes
i think option a should be true beacause both the cases we can not perform every operation in constant time
0 votes
0 votes
Delete_stack () using array cannot be performed in constant time since if we delete any element except last we have to shift all the other elements..so it will take O(n) time...

While empty_stack means emptying whole stack which takes O(1) time...correct me if i m wrong..
0 votes
0 votes
ans is option C.

Cause using array we can perform all the operation in S1.for delete stack we need to dynamically allocate array.

Option b is false.

Option c,d are true .

Related questions

2 votes
2 votes
0 answers
2
MiNiPanda asked Jan 17, 2018
441 views
Not able to understand the question. Kindly elaborate along with an explanation. Thank you.
2 votes
2 votes
2 answers
4
jatin khachane 1 asked Dec 1, 2018
1,221 views
My doubt : What should we consider ^ operator as Bitwise XOR ? or Exponentiation