What is a stage and scene?
Stage = window in which the JavaFX application is running
Scene contains a single control, such as a button or label
What is an abstract data type?
A data type model defined by its behavior from the point of view of a user of the data
Diagram any type of binary tree and describe what makes it as such
a tree data structure where each node has at most two children
Name five JCF implementations you're allowed to use!
HashMap, TreeMap, HashSet, TreeSet, LinkedList, ArrayList, Queue, Stack, PriorityQueue
What's your favorite place to study on campus?
Jennie's: RNG hehe I like to try new places everytime
What is a layout?
A node of nodes (e.g. an HBox)
What are the differences between stacks and queues?
LIFO vs FIFO
Different method names
Label a leaf, internal node, and root node on a board diagram
do you node da wae
Compare comparable with comparator
Comparable: used to define the natural ordering of the objects within the class
Comparator: used to define custom sorting logic externally
What makes a binary tree balanced?
If there are just as many nodes on the right and left sides
Name three types of layouts
HBoxes, VBoxes, GridPanes, BorderPanes, StackPanes
How do you get to the tail node in a linked list?
What is infix traversal?
In-order traversal: left, middle, then right node
What does Observer do?
the concrete observer implements Observer and notify()s when the subject's trigger has been observed
What is a generic?
Essentially a placeholder that allows for creating classes and interfaces that work with any type
Make a button factory method!
private static Button makeButton(String text) {
Button button = new Button(text)
button.setOnAction(), button.setStyle(), etc
return button
}
What is the time complexity of all basic ArrayList vs LinkedList operations?
AL: O(1) (except sometimes append)
LL: O(1) for append and anything on head on tail, otherwise O(n)
What are the differences between a heap and BST?
A heap places highest or lowest at top and doesn't care about horizontal order, BST maintains a sorted order where each node's left child is smaller and each right child is larger
Write an example of a lambda expression using the interface EventHandler
button.setOnAction((ActionEvent event) -> {
System.out.println("did you know dyeing your hair blue makes you live longer?");
});
What are the differences between TreeSet/TreeMap and HashSet/HashMap?
TreeSet/TreeMap are sorted and slower
Discuss & code an example of the JavaFX components that should be used to create a GUI for this Jeopardy
Label + gridpane of buttons
Describe a circular array
Used to implement queue, is circular if the first element is also next of the last element
Diagram what order a heap and BST are traversed
Heap: Root node downwards in equal horizontality
BST: Bottom up, left-middle-right
Make an iterator for an array of letters
public class LetterArrayIterator implements Iterator{
hasNext(){ return index < array.length;}
next(){return letters[index++]}
}
Explain the MVC pattern! (Diagram it for some extra points too)
Model = Application building blocks
View = Current state of the model in viewable form
Controller = Translates actions