Skip to content

Instantly share code, notes, and snippets.

@tmosest
Created February 7, 2017 21:29
Show Gist options
  • Save tmosest/68f204951409e822db569aac8775f038 to your computer and use it in GitHub Desktop.
Save tmosest/68f204951409e822db569aac8775f038 to your computer and use it in GitHub Desktop.
Constant Theta Complexity
/**
* This function has a constant space complexity.
* The function call and the variable declaration both take some memory but they don't grow with x.
*/
public static int addThree(int x)
{
int y = 3;
return x + y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment