Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Naman Jindal
How to handle time complexity in Js or Python scenario?

Naman Jindal

Jul 7, 2024

The solution says that the time comp for the pop() operation is O(1). but Javascript implementation uses shift() which is O(n) in itself. Is there any way to handle this? or do we have no other choice?

1

0

Comments
Comments

On this page