Queue implemented using two stacks has amortized time complexity of enqueue operation equal to:
O(n²)
O(1)
O(n)
O(log n)
Boost your performance with adaptive practice tests
Practice every concept in the syllabus
Compare your speed and accuracy with your peers
Download the app and practice on the go