Define iteration in computing.
A single cycle of a repetitive process in programming or algorithms.
True or false: Iterations can only be executed in loops.
FALSE
Iterations can also occur in recursive functions.
What is a for loop?
A control flow statement for specifying iteration with a counter.
Fill in the blank: An infinite loop occurs when _______.
The exit condition is never met.
Define recursive iteration.
A process where a function calls itself to solve smaller instances.
What is the purpose of iteration in algorithms?
To repeatedly execute a block of code until a condition is met.
True or false: While loops require a predetermined number of iterations.
FALSE
While loops continue until a specific condition is false.
What is a do-while loop?
A loop that executes at least once before checking its condition.
Fill in the blank: Recursion is a form of iteration that involves _______.
A function calling itself.
Define nested loops.
Loops within other loops, allowing for multi-dimensional iteration.
What is the break statement used for?
To exit a loop prematurely based on a condition.
True or false: Continue skips the current iteration and proceeds to the next.
TRUE
What is an iterator?
An object that enables traversal through a collection, like arrays.
Fill in the blank: Iteration can improve performance by reducing _______.
Redundant calculations.
Define loop control variables.
Variables that determine the number of iterations in a loop.
What is algorithmic efficiency in iterations?
It measures the time and space complexity of iterative processes.
True or false: For-each loops are used for iterating over collections.
TRUE
What is the time complexity of a linear iteration?
O(n), where n is the number of iterations.
Fill in the blank: Iteration is often used in _______ to refine results.
Machine learning algorithms.
Define loop unrolling.
An optimization technique that reduces the overhead of loop control.
What is a foreach loop?
A loop that iterates over elements in a collection without an index.
True or false: Recursion can replace iteration in all cases.
FALSE
Recursion can lead to stack overflow if too deep.
What is a count-controlled loop?
A loop that runs a specific number of times based on a counter.
Fill in the blank: Nested iterations can lead to _______ complexity.
Exponential