What is a built-in C++ array?
A built-in array stores a fixed number of elements of the same type in contiguous memory.
Study 6 Arrays and Collections with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a built-in C++ array?
A built-in array stores a fixed number of elements of the same type in contiguous memory.
What are the valid indexes of an array with N elements?
The valid indexes are from `0` through `N - 1`; the last valid index is therefore N−1.
What happens when a C++ array is accessed out of bounds?
Accessing an element outside the array's valid index range produces undefined behavior.
What is `int values[5] = {10, 20};` initialized to?
`values` becomes `{10, 20, 0, 0, 0}` because omitted elements are value-initialized.
How many elements does `int primes[] = {2, 3, 5, 7, 11};` contain?
`primes` has five elements because C++ deduces the bound from the number of initializers.
How many elements does `char word[] = "cat";` contain?
The array contains four characters: `'c'`, `'a'`, `'t'`, and the terminating null character `\0`.
When should a range-based loop use a reference?
A range-based loop visits each element directly; use a reference such as `int& value` when the loop must modify elements.
What is a two-dimensional C++ array?
A two-dimensional array is an array whose elements are one-dimensional arrays, commonly representing rows and columns of a table.
What is `matrix[1][2]` for `{{1,2,3},{4,5,6}}`?
`matrix[1][2]` is `6`: the first subscript selects the second row, and the second selects its third column.
How does a linear search examine an array?
A linear search examines elements sequentially from the beginning until it finds a match or reaches the end.
What is the worst-case complexity of linear search?
Its worst-case time complexity is O(n), because it may inspect every element.
Why cast the sum when calculating an array average?
Cast the sum to `double` before division, such as `static_cast<double>(sum) / count`; otherwise integer division discards the fractional part.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.