Last active
April 24, 2020 16:44
-
-
Save adslaton/fb3f733891f62fa15173c99db03cff81 to your computer and use it in GitHub Desktop.
Big O Constant Time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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