Python Basics
(Weeks 01-05)
Data Structures
Algorithms
(Searching & Sorting)
Big Picture
Miscellaneous
100

The conditional that ends a recursive function.

What is the base case?

100

A FIFO data structure that keeps order.

What is a Queue?

100

Identify the time complexities that we have covered this semester.

O(N^2), O(N), O(NlogN), O(logN), O(1)

100

For a block that needs to run as long as a given condition is true, one would most likely use the following kind of loop.

What is a while loop?

100

Determine the shape does the following Turtle code draws.

for _ in range(4):

    turtle.fd(100)

    turtle.lt(90)


What is a square?

200

The three loop mechanisms we covered.

What are for loops, while loops, and recursion?

200

A Python implementation of a hash table.

What is a dictionary?

200

A stable and optimal sorting algorithm.

What is MergeSort?

200

The type of data structure that a recursive function would be most appropriate for.

What is a recursive data structure?

200

This method when called with no arguments removes all whitespace (tabs, spaces, newlines, etc) from a string on both ends.

What is strip()?

300

This keyword is used to exit from a loop.

What is 'break'?

300

A tree with two child nodes, one less in value and one greater in value than the parent.

What is a Binary Search Tree (BST)?

300

Identify the two search algorithms we have covered.

What are Linear and Binary Search?

300

To keep track of the progress on a shopping list (how many items we have so far) one would most optimally use which data structure?

What is a set?

300

The method of making a dataclass instance immutable

What is frozen=True?

400

The purpose of this code:


with open("file.txt", "r") as f:

    for line in f:

        print(line.split())


What is printing every line in a file?

400

A process for lowering collisions in a hash table, without modifying the hash function

What is rehashing?

400

List the following algorithms in descending order by time complexity:

Merge Sort

Binary Search

Insertion Sort


Merge Sort, Insertion Sort, Binary Search

400

For immutable, ordered collections, one would use this data structure.

What is a tuple?

400

What a Python function returns when it returns multiple values.

What is a tuple return?

500

The output of this code:

"Something"[:4] + "Something"[4:]


What is "Something"?

500

All recursive problems can be solved iteratively using this data structure.

What is a stack?

500

Consider an algorithm that bisects the list for every element within it.


Determine the Big O notation for the time complexity of this algorithm.

What is O(NLogN)?

500

To keep track of a thing with multiple named parts, one would use this data structure.

What is a dataclass?

500

These are the three types of errors.

What are syntax, runtime, and semantic errors?

M
e
n
u