Skip to content

Files

Latest commit

 

History

History

Complexity

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Complexity

Examples of O(1)

  • Accessing the length of an array
  • Modulo Operator
  • Setting/Accessing object values

Examples of O(n)

  • Iterating over elements in an array
  • .find(), .map(), .filter()
  • ===, iterates over each char to check equality

Examples of O(n^2)

  • Nested for loop
  • Assigning new values inside a for loop
  • === inside a for loop: iterates over each char to check equality of each char