Skip to content

Instantly share code, notes, and snippets.

@jecrockett
Created February 22, 2016 20:29
Show Gist options
  • Save jecrockett/55d7f7187739dddcae50 to your computer and use it in GitHub Desktop.
Save jecrockett/55d7f7187739dddcae50 to your computer and use it in GitHub Desktop.

Big O Notation

Overview

  • What is Big O Notation? What does it measure? (Time and Space, we're going to focus on time today)
  • How can we use it? (technical interviews, plus like, writing code every day)

Core Examples

  • O(1): 'Constant time'
  • O(n): 'Linear time'
  • O(n^2): 'Quadratic time'
  • Graph depiction of those time costs

Interesting properties to consider:

  • Dropping constants (illustrate the devaluation of constants as input increases)
  • Defining the "worse case" scenario (illustrate how code can have a range of Big O values (example of O(1) to O(n))

Technical Interview Question Breakdown Example

  • Will pick an InterviewCake question and walk through potential solutions and illusrate the Big O value for the different solutions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment