On this page:
Problem statement
6.2.1

8 Lecture 8: Practice Design

Solving a larger problem: practice with wish lists, decomposing problems into subproblems, recursive methods on trees

Problem statement

Suppose you are working on a research paper, and you have gathered a set of documents together for your bibliography: books and Wikipedia articles. Every document has an author, a title, and a bibliography of documents; additionally, books have publishers, and wiki articles have URLs.
  • Since you know that wiki articles are not necessarily authoritative sources[citation needed], you want to produce a bibliography containing just the authors and titles of the books you’ve found, either directly or transitively through the bibliographies of other documents. Format the entries as “Last name, First name. "Title".”

  • Since bibliographies must be alphabetized, sort the bibliography by the authors’ last names.

  • Documents may be referenced more than once, but should only appear in the bibliography once. Remove any duplicates (defined as the same author name and the same title)