1/74
Comprehensive vocabulary flashcards covering logic gates, control flow, programming language conventions, variables, arrays, patterns, functions, scope, errors, and number systems from the Notre Dame Fundamentals of Computing Placement Test Study Guide.
Boolean
A value that is either true (1) or false (0).
AND gate
Output is true only when BOTH inputs are true.
OR gate
Output is true when AT LEAST ONE input is true.
NOT gate
Flips the input. True becomes false, false becomes true.
XOR gate (exclusive or)
Output is true when the inputs are DIFFERENT (exactly one is true).
NAND gate
NOT AND. Output is false only when both inputs are true.
NOR gate
NOT OR. Output is true only when both inputs are false.
XNOR gate
NOT XOR. Output is true when the inputs are the SAME.
Order of operations for logic
NOT first, then AND, then OR. Use parentheses to be safe.
De Morgan's Law 1
NOT(A AND B)=(NOT A) OR (NOT B)
De Morgan's Law 2
NOT(A OR B)=(NOT A) AND (NOT B)
Double negation
NOT(NOT A)=A
Identity rules
A AND true=A and A OR false=A.
Domination rules
A AND false=false and A OR true=true.
Short-circuit evaluation
In A AND B, if A is false, B is never evaluated. In A OR B, if A is true, B is never evaluated.
Truthiness
In many languages, 0 counts as false and any nonzero value counts as true.
Conditional (if statement)
Runs a block of code only if a condition is true.
if / elseif / else chain
Only ONE branch runs: the first one whose condition is true. If none are true, else runs.
Condition
An expression that evaluates to true or false.
= vs ==
= assigns a value (x=5). == compares two values (x==5).
Loop
Code that repeats multiple times.
Iteration
One single pass through a loop.
For loop
Repeats a known number of times, usually counting through a range.
While loop
Repeats as long as its condition is true. Checks the condition BEFORE each pass, so it may run zero times.
Nested loop
A loop inside another loop. The inner loop finishes completely for every one iteration of the outer loop.
Nested loop count
If the outer loop runs 3 times and the inner runs 4 times, the inner body runs 3×4=12 times.
break
Exits the loop immediately.
continue
Skips the rest of the current iteration and jumps to the next one.
Infinite loop
A loop whose condition never becomes false, so it never stops.
Loop counter
A variable that tracks which iteration the loop is on (often i, j, k).
Accumulator
A variable that builds up a result across loop iterations (for example, total = total + i).
Zero-indexing
The first element is at position 0. Used by Python.
One-indexing
The first element is at position 1. Used by MATLAB.
Inclusive range
The end value is included in the range (e.g., MATLAB 1:5 gives 1, 2, 3, 4, 5).
Exclusive range
The end value is NOT included in the range (e.g., Python range(5) gives 0, 1, 2, 3, 4).
Off-by-one error
A mistake caused by being wrong by exactly one, usually from indexing or range boundaries.
Variable
A named storage location that holds a value.
Assignment
Storing a value in a variable. The right side is evaluated first, then stored in the left side.
Modulo (mod or %)
Gives the remainder after division (for example, 7 mod 3 = 1).
Integer division
Division that drops the decimal part (for example, 7 // 3 = 2).
Array (or list)
An ordered collection of values stored under one name.
Index
The position of an element in an array.
Element or value
The data stored at a given index. The index is NOT the same as the value.
Array length
The number of elements in the array.
Traversal
Looping through every element of an array.
String
A sequence of characters, like text.
Concatenation
Joining two strings together.
Sum pattern
Set total = 0, loop through the array, add each element to total.
Count pattern
Set count = 0, loop through, add 1 to count whenever a condition is true.
Max pattern
Set max = first element, loop through, if element > max then max = element.
Min pattern
Set min = first element, loop through, if element < min then min = element.
Reverse pattern
Swap the first and last elements, then the second and second to last, and so on until you reach the middle.
Linear search
Loop through each element and check if it matches the target.
Function
A reusable block of code that can take inputs and give back an output.
Parameter
A variable in the function definition that receives an input.
Argument
The actual value passed into the function when it is called.
Return value
The output a function sends back to where it was called.
Function call
Running a function by using its name with arguments.
Scope
The part of a program where a variable can be accessed.
Local variable
A variable created inside a function. It cannot be used outside that function.
Global variable
A variable created outside all functions, accessible in many places.
Algorithm
A step-by-step procedure for solving a problem.
Pseudocode
Plain-language code that describes logic without strict syntax of a real language.
Debugging
Finding and fixing errors in code.
Syntax error
A mistake in how the code is written (breaks the language rules).
Logic error
Code runs but gives the wrong result because the logic is flawed.
Runtime error
An error that happens while the program is running, such as an index out of range.
Recursion
When a function calls itself. Needs a base case to stop.
Base case
The condition in a recursive function that stops further calls.
Binary
Base 2. Uses only digits 0 and 1.
Decimal
Base 10. Uses digits 0 through 9.
Hexadecimal
Base 16. Uses digits 0-9 and letters A-F (A = 10, F = 15).
Bit
A single binary digit (0 or 1).
Byte
8 bits.