?

Algorithms & Data Structures

Free Version

Upgrade subject to access all content

Easy

Choosing the Right Data Structure for a Social Network

ALGOR-VLL1IG

You are asked to choose a data structure to represent an online social network. The data structure needs to be able to represent individual users and the friendships between them. Which of the following data structures is most appropriate for this task?

A

An array.

B

A graph.

C

A tree.

D

A linked list.