Data Structures Quiz: Lists, Trees, Maps

Data Structures: Lists, Trees, Maps: ten questions on storage choices and operation costs. Includes calculations; answers explained.

Free, with no sign-up.

For High school students and adults reviewing the topic.

About 10 minutes. 10 questions.

How does it work?

  1. Choose one answer or enter a number in the stated unit, then check it.
  2. Read the explanation before continuing.
  3. Round only the final answer to the precision requested.

What will you get?

See your score and review the reasoning behind each answer.

Question 1An array has 13 items indexed from zero. Find the index of its last item as a whole number with no unit.

Answers within 0.5 of the expected value are accepted.

Question 2Push 14, then 27, then 39 onto an empty stack. Pop once, then push 52 and pop once. What value is returned by the second pop? Enter a whole number with no unit.

Answers within 0.5 of the expected value are accepted.

Question 3Binary search checks the middle item of a sorted array and discards that item and the unneeded half after each failed check. For 31 items, find the maximum number of middle-item checks, as a whole-number count with no unit.

Answers within 0.5 of the expected value are accepted.

Question 4An editor must undo the most recent action before earlier ones. Which interface matches that requirement?
Question 5Jobs arrive at a printer and must be served in arrival order. Which interface fits?
Question 6A program retrieves a student record using a unique student identifier. Which arrangement directly matches the lookup?
Question 7An application represents folders that contain subfolders. Which structure expresses this relationship?
Question 8A linked list must return the item at a numbered position, with no saved reference to that node. What work is required?
Question 9Sorted keys are inserted into a plain binary search tree without rebalancing. What risk does this create?
Question 10A playlist must preserve repeated songs and their chosen order. Which structure fits those requirements directly?

Answer every question to see and share your score.

Read the topic guide