In Linear Search, how do you find an item in a list?
Go through each item one by one until you find it.
Which sorting algorithm finds the smallest item and swaps it to the front?
Selection Sort
What is a function in programming?
A set of instructions that does a task when called.
What two numbers make up the binary system?
0 and 1
What is a loop used for?
Repeating a task multiple times.
Why is Binary Search faster than Linear Search?
It divides the list in half each time, so it finds the item faster.
What does Insertion Sort do with each new number it sees?
It inserts it into the correct spot in the sorted part.
What is the main reason we use functions?
To reuse code and make programs organized.
What is the binary number 101 in decimal?
5
If a program runs an if statement, what is it checking?
A condition (whether something is true or false).
What is a requirement for using Binary Search?
The list must be sorted.
If you have a list that is almost sorted, which sorting method would be faster: Selection Sort or Insertion Sort?
Insertion Sort is faster because it moves fewer items.
If you call a function named makePizza(), what do you think it does?
It probably makes a pizza by following a set of steps.
What is 24 in decimal?
16
What is brushing your teeth until a timer stops or walking until you reach school an example of?
A loop.
If you have a list of 1,000 items, approximately how many steps does Binary Search take to find something?
About 10 steps (since Binary Search works in log₂N time).
Which sorting method goes through the entire list multiple times, picking the smallest item each time?
Selection Sort
What is the difference between a function and a loop?
A function runs when you call it, and a loop repeats a task many times.
What is the largest number you can store with 4 binary digits?
15 (1111 in binary)
What happens if you forget to write a stop condition in a loop?
The loop will run forever and never stop (infinite loop).
Which search algorithm would be better for searching a phone book: Linear Search or Binary Search? Explain why.
Binary Search is better because the phone book is sorted alphabetically, allowing us to divide and conquer instead of checking each entry one by one like Linear Search.
Which sorting method is like sorting playing cards in your hand—you pick up one card at a time and put it in the right spot?
Insertion Sort. It sorts by picking up one item at a time and placing it in the correct spot, just like organizing cards in your hand.
What happens if you call a function, but it doesn’t exist in the code?
You get an error because the computer doesn’t know what to do.
Convert the decimal number 13 into binary.
1101
How can you tell if one algorithm is better than another
A better algorithm is usually faster (uses fewer steps) and more efficient (uses less memory or resources).