Objects
OOP
Data Structures
Searches & Sorts
Big O
100

This key word creates/instantiates an object with the given identifier.

What is new?

100

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?

100

This is an abstract data type that follows a Last In, First Out (LIFO) ordering of elements.

What is a stack?

100

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?

100

This is the time complexity of accessing an element by index in an array stored in contiguous memory.

What is O(1)?

200

This access modifier protects the data by "hiding" the data from outside classses.

What is private?

200

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?

200

This data structure is most appropriate for implementing a First In, First Out (FIFO) order of processing tasks.

What is Queue?

200

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?

200

This is the average-case time complexity of a binary search on a sorted array of n elements.

What is O(log n)?

300

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?

300

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?

300

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?

300

This traversal of a binary search tree visits nodes in ascending sorted order of their keys.

What is In-Order Traversal?

300

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)?

400

This is a class that inherits attributes from a base or parent class.  

What a sub or child or derived class?

400

This object-oriented principle restricts direct access to an object's internal data and exposes it only through defined methods.

What is encapsulation?

400

This tree has all levels filled (except possibly the last), and nodes lean left. 

What is a complete tree?

400

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?

  1. if ( A[x] > A[i] )
    x ← i
    end if
  2. if ( A[x] > A[i] )
    A[x] ← A[i]
    end if
  3. if ( x > i )
    x ← i
    end if
  4. if ( x > i )
    A[x] ← A[i]
    end if

What option 1?

400

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)?

500

These methods allow for "hidden" data to be accessed or to be modified.

What are accessors/getters and mutators/setters?

500

A method that implementing classes must define. (Note: the classes do not need to be related)

What is an interface?

500

This is an example of a _____ tree: 

              1

            /     \

         2           3

     /      \

  4          5

           /     \

         6        7

What is a full tree?

500

Is the postorder traversal for the following tree:

                1

             /      \

           2         3

        /     \     /    \

      4      5   6       7

What 4 5 2 6 7 3 1?

500

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)?

M
e
n
u