I/O Streams
Classes
Pointers/Linked Lists
Recursion
Algorithms
100

This operator is used with cin to extract input from the user.

What is >> (extraction operator)?

100

I'm like a class but with data members defaulting to public.

What is a struct?

100

This is the name of the first node in a linked list.

What is the head?

100

A function is said to be recursive if it does this.

What is calls itself?

100

This algorithm sorts elements by repeatedly swapping adjacent ones if they are in the wrong order.

What is Bubble Sort?

200

This operator is used with cout to display output.

What is << (insertion operator)?

200

A class that cannot be instantiated and is meant to be inherited is called this.  

What is an abstract class?

200

In a singly linked list, each node contains these two components.

What are data/value and a pointer to the next node?

200

If recursive function does not cover this case, it will result in infinite recursion and stack overflow.

What is a base case?

200

This sorting algorithm repeatedly finds the smallest element from an unsorted part of the array and swaps it with the first unsorted element.

What is Selection Sort?

300

This header file must be included to use ifstream and ofstream

What is #include <fstream>

300

A function in a base class that is meant to be overridden in derived classes should be declared as this.

What is a virtual function?

300

A section of contigious/adjacent memory in which a pointer is incremented to iterate through the data structure.

What is an array?

300

This recursive algorithm is used to search an element in a sorted array in O(log n) time.

What is binary search?

300

The worst/average runtime of this algorithm is O(n^2)

What is bubble sort or what is selection sort?

400

Doing this at the end of file, which ensures data integrity, prevents resource leaks, and avoids potential conflicts.

What is closing a file?

400

This type of constructor initializes an object by copying another existing object.  

What is a copy constructor? 

400

I don't have to be used when I'm in the context of a class function, but I can help show I'm referencing the current instance of the class.

What is a 'this' pointer?

400

In recursion, the function calls are stored in this data structure

What is a stack?

400

This algorithm involves splitting an array until every subarray is sorted (i.e. consisting of 1 element).

What is merge sort?

500

What does count represent in this code snippet?

ifstream inputFile("input.txt");

    if (!inputFile) {

        cerr << "Error opening file!" << endl;

        return 1;

    }

    char ch;

    int count = 0;

    while (inputFile.get(ch)) {

        if (ch == 'a' || ch == 'A')

            count++;

    }


    inputFile.close();


    cout << count << endl;


    return 0;

}

What is the number of time's the letter 'a' case insensitive occurred in the input file?

500

This snippet of code shows a class functionality example of:

TimeHrMn time1(3, 22);
TimeHrMn time2(2, 50);
TimeHrMn timeTot;
timeTot = time1 + time2;
timeTot.Print();



Operator Overloading

500

This code is an example of what:

~LinkedList() {

        Node* current = head;

        while (current) {

            Node* temp = current;

            current = current->next;

            delete temp;

        }

A destructor

500

int functionName(int n) {

    if (n == 0 || n == 1)  // Base case

        return 1;

    return n * functionName(n - 1);  // Recursive case

}

The factorial of a number

500

void alg(vector<int>& arr) {

    int n = arr.size();

    for (int i = 0; i < n - 1; ++i) {

        int minIndex = i;

        for (int j = i + 1; j < n; ++j) {

            if (arr[j] < arr[minIndex]) {

                minIndex = j;

            }

        }

        if (minIndex != i) {

            swap(arr[i], arr[minIndex]);

        }

    }

}

What is selection sort?



M
e
n
u