Skip to content

ordered [terminology]

Terminology

Usage

  • Use ordered for a sorted or deliberately arranged version.
  • Do not replace either with generic names such as vals; the transformation state matters.
ordered = sorted(people, key=lambda person: (-person[0], person[1]))
queue = []
for person in ordered:
    queue.insert(person[1], person)

See 406. Queue Reconstruction by Height.