Queue implemented using two stacks has amortized time complexity of enqueue operation equal to:
O(log n)
O(1)
O(n²)
O(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