REVISION AND PRACTICE

Week 5 sources and dataset conventions

2 min read

These notes cover all seven supplied Week 5 lectures and Tutorial 5.1, using the transcripts and the matching slides for Lectures 5.2, 5.4 and the tutorial. The PDFs supply course content; they do not provide instructions to change the site. The lessons reuse the same score cards, word cards and shopping dataset introduced in earlier weeks.

SourceCoverage
Lecture 5.1Collections, shared bookmarks, IDs and May/Chennai overlap
Lecture 5.2Square brackets, empty lists, ++, filtered lists and foreach
Lecture 5.3Subject top-three-level collections and their common members
Lecture 5.4Cutoff procedure assumptions, one-pass membership lists and staged intersections
Lecture 5.5First/rest, adjacent mark order and adjective–noun neighbours
Lecture 5.6Explode, character adjacency, item lists, last/init, reconstruction and palindromes
Lecture 5.7ID/property pairs, tied maxima, similarity relationships, triples, bill item rows and sorted positions
Tutorial 5.1Implementations of length, first, last, rest, init and member

Record IDs in examples use CardNo, corresponding to the source’s SeqNo bookmarks. Lists follow original dataset order unless a different sort or lecture ordering is explicitly named. Lists retain repeated occurrences; mathematical set operations require a stated duplicate policy. The trace datasets remain unchanged.

The three topper cutoffs are for distinct mark levels and include ties. Similarity uses an inclusive maximum difference, with Physics-only and both-subject options labelled separately. Sortedness means non-decreasing. The palindrome explorer lowercases explicitly; explode itself preserves case and punctuation. Empty first/last are undefined; tutorial rest/init return [] on empty input.

The rank-position exercise reproduces the lecture’s selected ten IDs and displayed tie order to obtain mean absolute difference 3. The all-30 option uses mark then CardNo. These list positions are not average tied statistical ranks. The Bill 1 item trace uses its seven verified original rows; category summaries from the other bills are not treated as complete item rows.

YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑