Recursion and Iteration
Sorting and Searching Algorithms
Dictionaries and Sets
Stacks and Queues
Linked Lists
100

What is recursion

what is recursion

100

Time complexity for Insertion sort worst case

O(N^2)

100

How do you denote a set

Curly brackets, {}

100

What is a LIFO structure

Last in First out, Stack
100

How do you instantiate a linked list with a length of 1

newllist = LinkedList('A', None)

200
The function that allows us to iterate over a range of numbers

range()

200

Time complexity for merge sort

O(N log N)

200

How to check if something is in a dictionary

thing in dictionary

OR

if dictionary['key']

200

What is a FIFO structure

First in First out, Queue

200

How do you instantiate a linked list with a length of 2

myList = LinkedList('A', LinkedList('B', None))

300

What stops a recursive call

Base case


300

Best way to search through a sorted list to find a number

Binary search

300
What are the two ways to create a dictionary
dict() and {}
300

Fields of a queue

Front, back, size

300

What does frozen=True do

Forces the data class to remain as is without adding more entities

400

The error you get when you try to infinitely recurse

Stack Overflow, or Max recursion depth exceeded

400

Describe quick sort

Get a pivot value and create 3 lists that contain values less than, equal to, and greater than the pivot. This is recursively done until all lists are of size one, then combined together to sort the list.

400

Difference between Set and Dictionary

The dictionary has values, whereas a set only has "keys"

400

Complexity of pushing and popping on a stack

Constant O(1)

400

Create a linked list data class

Open

500

Difference between general recursion and tail recursion

Last thing done in tail recursion is the recursive call

500

Describe Merge sort

Recursively divides the list down to lists of size one, then merges them back together to sort the list

500

What is special about a key in a dictionary

Keys must be immutable and unique in a dictionary

500

How do you add/delete an instance in a stack

stack.pop(), stack.push()

500

Difference between linked list and array list

Open