Unit 4: Iteration

Cards (13)

  • Infinite Loops: Occurs when the expression in a while loop never evaluates to false. The program continues to run infinitely.
  • break: Breaks out of a while loop and executes statements that immediately follow while loop.
  • return: Keyword used in methods to return a value back to the initial program that called the method.
  • Off by One Error: When a for loop iteration is off by one too many or one too few.
  • charAt(int index): returns the character at the specified index.
  • Nested Loops: When a loop is placed within another loop. The total number of runs for a nested loop will be the outer loop * inner loop.
  • Statement Execution Count: The number of times a statement is executed by the program.
  • Big-O Notation: A way to represent how long an algorithm will take to execute. It helps to determine how efficient different approaches to solving a problem are.
  • While Loop: a programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is true
  • for loop: A programming construct that allows for a block of code to be executed a specified number of times.
  • loop control variable: a variable that determines whether a loop will execute.
  • String traversal: Using a loop to cycle through each character in a string
  • Nested loop: A loop inside the body of another loop.