Skip to content

Instantly share code, notes, and snippets.

@adslaton
Last active April 24, 2020 16:44
Show Gist options
  • Save adslaton/fb3f733891f62fa15173c99db03cff81 to your computer and use it in GitHub Desktop.
Save adslaton/fb3f733891f62fa15173c99db03cff81 to your computer and use it in GitHub Desktop.
Big O Constant Time
// Represents an algorithm that will always execute in the same time or space regardless of the size of the input data set
// 1.
x = 10 + (2 * 3); // Big O of 1 or O(1)
// 2.
x = 10 + (2 * 3); // O(1)
y = 1 + 2; // O(1)
console.log(x + y); // O(1)
// O(1) + O(1) + O(1) or 3 * O(1) = O(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment