This is the name for an ordered sequence of steps that transforms inputs into outputs
Procedure
What is the first step in identifying a correct procedure?
Decompose the problem into atomic steps.
What is a sub-procedure also commonly called?
A function or method.
What type of decision has only two possible outcomes?
A binary decision (yes/no).
What is a condition?
A Boolean expression that evaluates to true or false.
Name one benefit of using sub-procedures.
Reusability, abstraction, modularity, or teamwork.
What logical operators are commonly used in conditions?
AND, OR, NOT.
What does pre-planning mean?
Preparing resources or structures before they are needed.
What is a pre-condition?
Something that must be true before an algorithm executes.
Give one example of an exception.
Division by zero, file not found, invalid input, etc.
What is concurrency?
Executing tasks at the same time.
What must be true for tasks to be implemented concurrently?
They must not depend on each other’s results.
What is abstraction?
Ignoring irrelevant details to focus on essential ones.
Why is abstraction required?
To manage complexity and focus on essential details.
What is the difference between a real-world entity and an abstraction?
An abstraction is a simplified representation of the real entity.
What is the Big O efficiency of binary search?
O(log n).
What is the Big O efficiency of bubble sort?
O(n²).
Name two standard operations of collections.
Add, retrieve, remove, iterate, search.
In a flowchart, what shape represents a decision?
A diamond.
Which search algorithm requires a sorted array?
Binary search.
In the binary search example, how many comparisons were needed to find 33?
Array = [2, 5, 8, 12, 26, 33, 38, 56]
Two comparisons.
What is the output of the pseudocode example
x ← 5
y ← 10
while x < y do
x ← x + 1
y ← y - 1
end while
output x
8
Create a true table
text
count ← 0
for i ← 1 to 5
for j ← 1 to 3
count ← count + 1
end for
end for
El bucle externo (i) se ejecuta 5 veces (1, 2, 3, 4, 5)
Por cada valor de i, el bucle interno (j) se ejecuta 3 veces (1, 2, 3)
Total = 5 × 3 = 15 veces
What are the four fundamental computer operations?
Add, compare, retrieve (load), and store.
Why are high-level languages needed?
They are easier to write, read, maintain, and are portable.