Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
O(1) or Constant Complexity Gist
function add_numbers(a, b, c) {
let total = 0 //O(1) --> constant complexity (a variable is initialized)
total = a + b + c //O(1) --> constant complexity (a variable is re-assigned)
return total
}
add_numbers(2, 5, 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment