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
What are the four types of I/O?
Reader, Writer, InputStream, OutputStream
Does BFS get the shortest path?
Yes
Does DFS get the shortest path?
No
True or False: GUI's run on the same thread as the main thread?
False
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.
What is a decorator pattern?
When an object takes in another object to expand its functionality.
What are the elements that make up a graph?
Nodes and edges where the nodes are connected by edges.
What is pruning and where is it done?
Pruning is used to remove invalid configurations to prevent their successors from being generated.
What method is used to run the GUI and what order of methods are called after that?
Application.launch(args);
init, start, close
What is the syntax to throw an Exception with the message "sup"
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)
What is the time complexity of BFS?
O(|V| + |E|)
What is the time complexity of backtracking?
O(options^problem size)
Which methods do you call to set the elements of a BorderPane?
setTop, setLeft, setCenter, setRight, setBottom
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.
What is an adjacency list?
A list that describes the set of neighbors that a node has.
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.
Write the code that when a button is clicked then the function runButton is called.
button.setOnAction(e -> {runButton();});
What is the output of this function?
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.
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
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
Which tier usually creates the model tier and why?
The view tier because it needs to add itself as an observer.