Ready to begin
No records have been processed. Start with Next step.
Try a procedure with different inputs, then answer before revealing the explanation. Name the input representation, comparison key, tie policy and eligible population.
Follow the selected procedure. Change a field, tie rule or weekday and explain why the result changes.
Ready
No records have been processed. Start with Next step.
Predict the next change. Keep track of which list level, field and position convention the procedure uses.
For a paragraph represented as lists of character-list words inside sentence lists, what does first(first(P)) return?
The first word’s character list. One more first reaches its first character, provided each relevant list is non-empty.
Insert 3 into [1,3,3,5] using strict <.
The new occurrence goes after the old 3s: [1,3,3,3,5]. IDs or labels would show its relative position among equals.
Which line must run for every old insertion element, even after a match?
The line appending the old element to the output. Otherwise existing data may be lost.
Can you call the insert helper on an unsorted list and assume the result is sorted?
No. Its contract assumes a sorted input.
What two properties form the insertion-sort invariant?
The accumulated result is sorted and contains exactly the occurrences processed so far.
What does the tutorial’s ≤ do to equal-page insertion order?
It inserts the new equal-page record before old equals; the lecture’s strict < puts it after them.
Does sorting 30 items by the copying helper avoid all quadratic work on a favourable order?
No. It still copies 0+1+…+29 = 435 old elements. Key-comparison work is a separate count.
A sorted birthday run contains four students. How many equal-neighbour links and all unordered pairs?
Three equal-neighbour links, but six unordered student pairs.
What is the usual final-step bug in sorted group counting?
Forgetting to save the final group after the loop.
Under the displayed zero-based positional grading code, what are 30-student A/B/C/D counts?
7,7,8,8. This follows the exact comparisons, not a hand-adjusted quarter split.
Does first(G) return an ID when G=[AIDs,BIDs,CIDs,DIDs]?
No. It returns the whole AIDs list.
Maths A and Physics B: which of the two rules confirms it?
The looser both-A/B rule confirms it; the at-least-as-good rule rejects it.
Why does found need resetting for each student?
A match for an earlier student must not affect whether the next student is found.
Does exitloop mean return from the procedure?
No. It ends the nearest enclosing loop, then execution continues outside that loop.
For the library example, what does first(last(books)) mean?
The ID of the final, maximum-page book pair, not a page count.
02201: Kolkata 20:00 Day 1 to Bhubaneswar 03:30 Day 2. Duration?
450 minutes, or 7 h 30 min.
A Sunday origin departure reaches a station on Day 2. Which weekday?
Monday, one day later.
Why can train and station weekdays disagree without an error?
They may refer to different events or journey days. Align those meanings first; remaining mismatches should be flagged.
What is insufficient about checking only whether both station names occur in a route?
Direction and departure availability matter: source must precede destination, and service must run on the relevant source weekday.
What does a different-next-call junction clue fail to prove?
It does not prove physical track branching or that a timed transfer is feasible.