Exceptions
I/O
Graphs and BFS
DFS and Backtracking
GUI
100

What type of exception is a ClassCastException and when does it occur?

A ClassCastException is a Runtime Exception and it occurs when an object cast into another object that the object isn't

100

What are the four types of I/O?

Reader, Writer, InputStream, OutputStream

100

Does BFS get the shortest path?

Yes

100

Does DFS get the shortest path?

No

100

True or False: GUI's run on the same thread as the main thread?

False

200

What is the difference between a Runtime Exception and a Checked Exception?

A runtime exception doesn't have to be caught or thrown explicitly in the syntax and is an Unchecked Exception.

200

What is a decorator pattern?

When an object takes in another object to expand its functionality.

200

What are the elements that make up a graph?

Nodes and edges where the nodes are connected by edges.

200

What is pruning and where is it done?

Pruning is used to remove invalid configurations to prevent their successors from being generated.

200

What method is used to run the GUI and what order of methods are called after that?

Application.launch(args);

init, start, close

300

What is the syntax to throw an Exception with the message "sup"

300

Write the line of code to create a PrintWriter to System.out.  If you can also make it so the PrintWriter auto flushes when it encounters a new line (this is for double points).

PrintWriter pw = new PrintWriter(System.out, true)

300

What is the time complexity of BFS?

O(|V| + |E|)

300

What is the time complexity of backtracking?

O(options^problem size)

300

Which methods do you call to set the elements of a BorderPane?

setTop, setLeft, setCenter, setRight, setBottom

400

What is the difference between an Error and an Exception?

An error shouldn't normally be handled. They can be handled just like exceptions, except they probably shouldn't because it is very difficult to recover from and it isn't easy to locate where they occur with 100% certainty.

400

Create a BufferedReader that reads from System.in

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

400

What is an adjacency list?

A list that describes the set of neighbors that a node has.

400

What is a copy constructor and what is it used for?

A copy constructor is used to create new instances of the configuration that are successors of the current configuration.

400

Write the code that when a button is clicked then the function runButton is called.

button.setOnAction(e -> {runButton();});

500

What is the output of this function?

500

Why did we learn about IO and exceptions in the same week?

IOExceptions are often thrown when working with IO.  IOExceptions are checked exceptions.  It is impossible to learn about IO without first learning Checked Exceptions.

500

When going from A to I

What is the visiting order using BFS?

What is the path using BFS?

Visiting Order: A, B, C, E, G, D, F, H, I

Path: A, C, D, I

500

When going from A to I:

What is the visiting order using DFS?

What is the path using DFS?

Visiting order: A, B, G, H, D, C, F, I

Path: A, B, G, H, D, I

500

Which tier usually creates the model tier and why?

The view tier because it needs to add itself as an observer.