recategorized by
335 views

1 Answer

0 votes
0 votes

Ans: D) O(1)

Stack is the data structure with LIFO(Last In First Out) property.

In Linked-List based Implementation of stack.

  • push/ insert operation = create a data node and insert it at the head of the linked list and update the pointer.
  • pop/ remove operation = delete the node from the head of the list and update the "head" pointer.

Both operation can be done in O(1) operation.
 

Related questions

0 votes
0 votes
1 answer
1
go_editor asked Mar 26, 2020
703 views
In the balanced binary tree given below, how many nodes will become unbalanced when a node is inserted as a child of the node “$g$” ?$1$$3$$7$$8$