Foundations-of-Computer-Science practice question 11 of 15

Which statement about a graph in computer science is true?

Full set: 71 questions
Answer options
A:

A. It is always a bar chart used in spreadsheets

B:

B. It is a structure made of vertices and edges that can represent relationships

Correct answer
C:

C. It can only contain positive integers

D:

D. It is another name for an operating system process

Correct Answer:
B. B. It is a structure made of vertices and edges that can represent relationships
Explanation

In computer science, a graph is an abstract data type used to represent connections or relationships between pairs of objects. It consists of a finite set of vertices (also called nodes) and a set of edges that connect these vertices. Graphs are a fundamental data structure used to model networks, such as social networks, computer networks, road maps, and dependencies in a project. They are not inherently visual like a chart but are a mathematical and logical structure.

Why Incorrect

A. A bar chart is a data visualization tool. While it can represent data, it is not the abstract data structure known as a graph in computer science.
C. The data associated with vertices or edges in a graph can be of any type (integers, strings, objects, etc.), not just positive integers.
D. An operating system process is an instance of a running program. This is a concept related to operating systems, not the graph data structure.

References

1. Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2022). Introduction to Algorithms (4th ed.). MIT Press. Chapter 20, "Elementary Graph Algorithms," defines a graph G as a pair (V, E), where V is a set of vertices and E is a set of edges (Section 20.1).

2. MIT OpenCourseWare. (2011). 6.006 Introduction to Algorithms, Fall 2011. Lecture 13: Breadth-First Search (BFS). The lecture begins by defining a graph as a set of vertices and edges, emphasizing its use in modeling relationships.

Scroll to Top