JavaScript Data Structures & Algorithms Flashcards
1
Q
What is Big O notation?
A
Big O notation describes the complexity of a code using algebraic terms.
2
Q
How does O(n) work?
A
O(n) O of N, the number of operations is going to be proportional to whatever “n” is.
3
Q
How does O(2n) work? (or Oxn)
A
It runs the same as O of N, the number of operations is going to be proportional to whatever “n” is.
4
Q
How does O(n²) work?
A
O(n²) (“Big O squared”) completes tasks with fewer operations. Much more efficient than O(n).
5
Q
What is “Recursion”?
A
A function that calls itself, until it doesn’t.
6
Q
What is a “Callback”?
A
A function passed into another function as a parameter.
7
Q
A