This key word creates/instantiates an object with the given identifier.
What is new?
This is the relationship between Car and Vehicle shown on a UML diagram where class Car has a hollow triangular arrowhead pointing to class Vehicle. (Be specific about describing the relationship between the 2 objects.)
What is Car inheritits from Vehicle?
This is an abstract data type that follows a Last In, First Out (LIFO) ordering of elements.
What is a stack?
This search starts at one end of an array and checks every location until the target is found or all locations are checked.
What is linear search?
This is the time complexity of accessing an element by index in an array stored in contiguous memory.
What is O(1)?
This access modifier protects the data by "hiding" the data from outside classses.
What is private?
In a class hierarchy, a Dog class and a Cat class each provide their own makeSound method that overrides a common Animal method. Calling makeSound on an Animal reference produces the correct subclass sound at run time.
What is a polymorphism?
This data structure is most appropriate for implementing a First In, First Out (FIFO) order of processing tasks.
What is Queue?
This sorting algorithm repeatedly selects the smallest remaining element and places it in its final sorted position, one position at a time.
What is selection sort?
This is the average-case time complexity of a binary search on a sorted array of n elements.
What is O(log n)?
In object-oriented programming, this is a method used to initialize objects in a given class. It’s special because it shares its name with the class and does not have a return type associated with it.
What is a constructor?
In an object-oriented program, this feature allows a subclass to provide a specific implementation of a method already defined in its superclass.
What is a method overriding?
This tree has every single node has either exactly (2) children or (0) children. (A node can never have only 1 child).
What a full tree?
This traversal of a binary search tree visits nodes in ascending sorted order of their keys.
What is In-Order Traversal?
This is the Big-O notation for the worst-case time complexity for a linear search that examines an unsorted list of n elements one at a time.
What is o(n)?
This is a class that inherits attributes from a base or parent class.
What a sub or child or derived class?
This object-oriented principle restricts direct access to an object's internal data and exposes it only through defined methods.
What is encapsulation?
This tree has all levels filled (except possibly the last), and nodes lean left.
What is a complete tree?
Consider the following pseudocode segment with integer variables that implements a selection sort. Assume that A is an integer array of length n with indexing that starts at 0.
for ( int j ← 0; j < n − 1; j ← j + 1 )
int x ← j
for ( int i ← j + 1; i < n; i ← i + 1 )
// missing code block
end for
if ( x ≠ j )
swap ( A[x], A[j] ) // swap the two array entries
end if
end for
Which of the following could replace the missing code block so that the code segment will work as intended?
What option 1?
This is the time complexity a nested loop iterates over an n by n grid, performing constant work at each cell.
What is O(n2)?
These methods allow for "hidden" data to be accessed or to be modified.
What are accessors/getters and mutators/setters?
A method that implementing classes must define. (Note: the classes do not need to be related)
What is an interface?
This is an example of a _____ tree:
1
/ \
2 3
/ \
4 5
/ \
6 7
What is a full tree?
Is the postorder traversal for the following tree:
1
/ \
2 3
/ \ / \
4 5 6 7
What 4 5 2 6 7 3 1?
This is the time complexity for the worst case scenario for merge sort that sorts an array of n elements.
What is O(n log n)?