– The time required to insert an element in a stack with linked list implementation is
A. (1)
B. (log2 n)
C. (n)
D. (n log2 n )
Answer:A
– The time required to insert an element in a stack with linked list implementation is
A. (1) B. (log2 n) C. (n) D. (n log2 n )
Explanation: In stack element is added at the top of the stack .To implement stack usinglinklist ,element will always be added at the end. So, it will take O(1) time.