?

Algorithms & Data Structures

Free Version

Upgrade subject to access all content

Easy

Representing the Web as a Graph

ALGOR-Y0MBWM

The World Wide Web can be considered one giant graph where web pages are the nodes of the graph and hyperlinks are the directed edges connecting the nodes to each other. There are several ways to represent a graph like this.

Which of the following options is the best way of representing this graph?

A

A 2-dimensional array where the web pages are the rows and columns of the array. An index in the array has a value of 1 if the row web page has a hyperlink to the column web page and a 0 otherwise.

B

A binary heap where each web page is ranked by the number of hyperlinks it has to other web pages.

C

An adjacency list where each web page in the graph has an unordered list of the web pages that it has hyperlinks to.

D

A hash table where each web page is hashed based on the number of hyperlinks that point to it from other web pages.