sajad torkamani

In a nutshell

An algorithm is O(1) when the runtime doesn’t change as the input size grows. For example, with a stack data structure, adding a new item to the stack will require a single operation regardless of whether you have then items in the stack or a million items.