The method that gets you the first element in a stack?
What is Peek()?
Recursion
What is a method that calls itself?
the distance from the root to the lowest node
What is height?
This is the interface that an iterator must implement.
What is Iterator<E>?
This is the most efficient time complexity possible for any comparison-based algorithm.
What is O(1)
The two instance variables of a Node used in a LinkedList.
What is Data and next.
When working in java, the term for the potential issue found when the base case is never reached.
What is a stack overflow error?
the traversal algorithm: left, root, right
what is inorder traversal?
The amount of times a method can recursively call itself in intellij before a StackOverflowError is thrown?
April Fools, you don't have to know this... You get 500 points :)
The actual answer is What is 22944?
I don't know why they know this, I think they are friends with Mr. Huffman :) jk
This is the runtime of linear search
What is O(n)?
The policy for adding/removing in a Queue.
What is FIFO?
Given this method with the input n = 4. This is the output of the following method.
public static long fibonacci(int n) {
if (n == 1) {
return 1;
}
if (n == 0) {
return 0;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
What is 3?
the left node, right node, and data
what is stored inside a node?
This type of testing tests the unit with knowledge of its internal structure.
What is White Box testing?
For a regular binary tree without ordering properties, this is the time complexity for checking if a value exists.
What is O(n log n)?
Stack methods that throw EmptyStackException.
What is pop and peek?
Suppose we have a triangle made of blocks. The topmost row has 1 block, the next row down as 2 blocks, the next 3, and so on. This recursive method computes the total number of blocks in such a triangle with the given number of rows.
Public static int triangle(int rows) {.
if (rows == 1) {
return 1;
}
return triangle(rows - 1) + rows;
Balance the tree
what is a way to improve the runtime for a tree?
These are 5 of the tests you could perform on an add method for an ArrayList.
What are adding to an empty ArrayList, adding to the first index, adding out of bounds, adding to a negative index, adding to the index at the end, adding in the middle, adding to an ArrayList that does not exist, adding an item that does not exist, etc.?
This time complexity represents the efficiency of finding an element in a balanced binary search tree.
What is O(log n)?
The two top interfaces in the Java Collections hierarchy?
What is Collections and Iterable?
This is the time complexity of the Fibonacci method we did in class.
Hint: return fibonacci(n - 1) + fibonacci(n - 2);
What is O(n2) (n squared) ?
a tree where each node has 0 or 2 nodes
what is a full tree?
This is the necessary backing class to be able to use an enhanced for loop.
What are collections?
When an algorithm always processes a fixed-size data structure like a binary tree with exactly 42 nodes, it has this time complexity regardless of the input values.
What is O(1)?