?

AP® Computer Science Principles

Free Version

Upgrade subject to access all content

Easy

Sorting Namecards

APCSP-KB54AL

Assume you have note cards with 20 student names on them. You want to sort them, and your friends suggest two different methods of sorting the cards

Alice suggests the following:

  • put all the cards on the table.
  • find the one what is first in alphabetical order, and place it in a pile.
  • find the next one in alphabetical order, and place it in the pile. Repeat until done.

Elizabeth suggests:

  • put one card on the table.
  • look at the next card. Place it in front of or behind the first card.
  • look at the next card. Place it in the correct location relative to the cards currently on the table. Repeat until done.

Which of the following best describes the situation outlined above?

A

Alice has a more efficient algorithm for sorting the names.

B

Elizabeth has a more efficient algorithm for sorting the names.

C

Either Elizabeth's or Alice's algorithm could be used to sort the names.

D

This is an example of combining the algorithm suggested to create a better solution to the problem.