a) O (n)
b) O (n2)
c) O (nlogn)
d) O (1)
Answer: d
Explanation: Deletion of the head node in the linked list is taken as the best case. The successor of the head node is changed to head and deletes the predecessor of the newly assigned head node. This process completes in O(1) time.
Related Posts
The result of the postfix expression 5 3 * 9 + 6 / 8 4 / + is _____________
Which of the following is valid reverse polish expression?
To convert the postfix expression into the infix expression we use stack and scan the postfix expression from left to right.
Consider the postfix expression 4 5 6 a b 7 8 a c, where a, b, c are operators. Operator a has higher precedence over operators b and c. Operators b and c are right associative. Then, equivalent infix expression is
The prefix expression of the postfix expression AB+CD-* is __________
What is the value of the postfix expression 2 3 + 4 5 6 – – *
The equivalent infix expression and value for the postfix form 1 2 + 3 * 4 5 * – will be ___________
Join The Discussion