Recursion/Unit 7
Data Structures
Data Structures 2
Sorting Algorithms
Time Complexity
100
The part of a recursive function that determines when it stops.

What is the base case(s)?

100

A data structure that is mutable, but cannot change size once created.

What is an array?

100

Immutable data structure; cannot change values or size after creation. 

What is a tuple?

100

Notation to sort in reverse.

What is reverse=True?

100

The time complexity of linear search.

What is O(n)/linear time?

200

The number of times a recursive call is made before it reaches the base case.

What is recursion depth?

200

A data structure that is mutable and can change size after creation.

What is a list?

200

Function to add an element to a specific index in a list.

What is .append()?

200

The non destructive python sorting function. 

What is sorted()?

200

The time complexity of binary search.

What is O(log n)?

300

A snapshot of the local frame and all the variables in scope.

What is a stack frame?

300

Function to remove an element from a list and return it.

What is .pop()?

300

This list operation combines two lists without modifying either original.

What is concatenation?

300
Used to change the default behaviour of a sort function.

What is a sort key?

300

The time complexity of merge sort - all cases.

What is O(n log n)?

400

The amount of memory the algorithm needs to use.

What is space complexity?

400

An array in which only some of the elements have data in them.

What is a sparse array?

400

What it means for an object to be mutable, vs. what it means for it to be mutable.

What is being able to change the value?

400
Insertion sort's best case function.

What are sorted/nearly sorted sequences?

400
Time complexities of quicksort: best, average, worst.

What is O(n), O(n log n), O(n^2)?

500

When an immutable type is passed into a function.

What is "passing by value"?

500

Explain the difference between an array, list, and tuple (for the purpose of this course). 

List: size can change, values can change
Array: a list if it couldn't use list operations or change size
Tuple: neither size nor values (directly) can change

500

Explain the comparator and its use.

Defining different sorting rules than normal behaviour, comparing two given objects

500

Explain why insertion sort's best case is O(n).

Assumes already sorted list - no shifting needed, just goes through it.