reading-notes

Linked Lists

Big O: Analysis of Algorithm Efficiency

Big O notation - apparently, the ‘O’ in big O stands for Ordnung, meaning the order of approximation.

Big O is used to classify algorithms by their run time or space requirements.

Running time - (time complexity) How long does this function need to complete its task?

Memory Space - (space complexity) How much computer memory resources will this function use to store data and computer instructions? “How efficient is our space consumption?”

Big O’s purpose is to describe a function’s worst case scenario.

Here are the 4 Keys Areas to consider when thinking of Big O:

  1. Input Size
  2. Units of Measurement
  3. Orders of Growth
  4. Best Case, Worst Case, Average Case

n Input Size: The size of the parameters read by the function.

Units of Measurement - quantify with:

  1. time in milliseconds (more useful checking the performance on specific hardware)
  2. number of operations (number of lines of code fun from start to finish)
  3. number of basic operations (usually the innermost loop)

Memory Space - four sources of memory usage:

  1. the space the lines of code itself takes to run the algorithm

  2. the space that the input data needs

  3. the space needed to hold the output data

  4. the space needed to hold working data during run time (stack space, recursive calls)

Orders of Growth - the order of magnitude that time and space requirements go up by when the size of the Input n increases

Orders of Growth Log Plot

How do we analyze big on with pen and paper?

Efficiency Notation

Notes:

Linked Lists

What’s a Linked List, Anyway pt1

What’s a Linked List, Anyway pt2

Previous Reading

Next Reading