Question 1 of 10
F: add then divide by 3. G: divide each by 3 then add. Inputs 3,6,9?
- A. Only F yields 6.
- B. Only G yields 6.
- C. Both yield 6.
- D. F yields 18 and G yields 6.
F: add then divide by 3. G: divide each by 3 then add. Inputs 3,6,9?
data = [4,4,5,4]. Missing step to count 4s from count ← 0 inside FOR EACH v IN data IF (v = 4)?
L=[7,2,9]. Swap indexes 1-2 if out of order, then 2-3 if out of order. L after that pair of checks?
Path U: REPEAT 2 TIMES { MOVE_FORWARD }. Path V: MOVE_FORWARD MOVE_FORWARD. Same start/facing?
Missing update with best ← vals[1]:
best ← vals[1]
i ← 2
REPEAT (LENGTH(vals) - 1) TIMES
{
IF (vals[i] > best)
{
_______________
}
i ← i + 1
}
Which pair can produce different results while both looping every element of the same nonempty list?
Guard for yes when k evenly divisible by 5?
Before [3,1,2], after [1,2,3]. Student claims one adjacent swap. Best response?
R uses nested IF for min of two numbers. S assigns first to m then replaces if second smaller. Inputs 8 and 3 both display 3. Illustrates?
sum of elements in total; n = LENGTH(list). Missing final average step?