Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Graphs - Revision

Total questions: 28

Worksheet time: 47mins

Name
Class
Date
1.

What is a graph in the context of data structures?

a)

A) A visual representation of quantitative data

b)

B) A data structure used to represent complex relationships

c)

C) A chart used to track changes over time

d)

D) A mathematical function plotted on a coordinate system

2.

Which term describes a graph where weights are assigned to edges?

a)

A) Directed graph

b)

B) Undirected graph

c)

C) Weighted graph

d)

D) Bipartite graph

3.

What is the difference between an undirected graph and a directed graph?

a)

A) An undirected graph has cycles, while a directed graph does not

b)

B) An undirected graph has no edge orientations, while a directed graph has edge orientations

c)

C) An undirected graph cannot have weights, while a directed graph can have weights

d)

D) An undirected graph is used for hierarchical data, while a directed graph is not

4.

What are the two common ways to represent a graph in computer memory?

a)

A) Adjacency matrix and adjacency list

b)

B) Array and linked list

c)

C) Stack and queue

d)

D) Binary tree and hash table

5.

What are the two common ways to represent a graph in computer memory?

a)

A) Adjacency matrix and adjacency list

b)

B) Array and linked list

c)

C) Stack and queue

d)

D) Binary tree and hash table

6.

Which representation of a graph is more space-efficient when the graph is sparse?

a)

A) Adjacency matrix

b)

B) Adjacency list

c)

C) Both are equally space-efficient

d)

D) Neither, as space efficiency does not depend on graph sparsity

7.

What is a graph in the context of data structures?

a)

A visual representation of quantitative data

b)

A set of vertices or nodes connected by edges or arcs

c)

A chart used to monitor changes over time

d)

A collection of interlinked web pages

8.

What is the characteristic of an undirected graph?

a)

All edges are one-way

b)

All edges are bidirectional

c)

All edges are weighted

d)

All edges are unconnected

9.

In a directed graph, how are the edges oriented?

a)

Bidirectional

b)

Multidirectional

c)

One-way

d)

Weighted

10.

How can a computer represent the information about distances and connections in a structured, numerical way?

a)

Using a physical map

b)

Through an adjacency matrix

c)

By writing descriptive paragraphs

d)

With a list of instructions

11.

What does each row and column in an adjacency matrix represent?

a)

A) A specific edge in the graph

b)

B) A node in the graph

c)

C) The weight of the edge

d)

D) The direction of the edge

12.

In an unweighted graph, what does the item at [row, column] in an adjacency matrix indicate?

a)

A) The weight of the connection

b)

B) The direction of the connection

c)

C) A connection between nodes

d)

D) The number of edges

13.

How would you represent a connection between nodes A and E in an unweighted graph using an adjacency matrix?

a)

A) Place a 0 at [A, E] and [E, A]

b)

B) Place a 1 at [A, E] and [E, A]

c)

C) Place a 1 at [A, E] only

d)

D) Place a 0 at [A, E] only

14.

What is an advantage of using an adjacency matrix for graphs?

a)

It uses less memory for sparse graphs.

b)

It is convenient to work with and adding an edge is simple.

c)

It automatically updates when new nodes are added.

d)

It requires no memory for disconnected nodes.

15.

Why is an adjacency list used in graph representation?

a)

It requires more storage than other representations.

b)

It is not suitable for representing large, sparsely connected graphs.

c)

It only uses storage for the connections that exist, making it more space-efficient.

d)

It is a good way to represent small, densely connected graphs.

16.

What type of graph is best represented using an adjacency list?

a)

A small, densely connected graph.

b)

A large, sparsely connected graph.

c)

A graph where every node is connected to every other node.

d)

A graph with uniform weight on all edges.

17.

Which of the following is an application of graphs where nodes represent computers and weighted edges represent bandwidth between them?

a)

Social networks

b)

Computer networks

c)

Chemistry

d)

Maps

18.

In graph terminology, what do you call a graph where each edge has a direction associated with it?

a)

Weighted

b)

Undirected graph

c)

Directed graph

d)

Vertices

19.

Which term refers to a graph that does not have any directed edges?

a)

Digraph

b)

Directed graph

c)

Undirected graph

d)

Weighted

20.

What is the term used for a directed graph where all the edges are one-way?

a)

Edges

b)

Undirected graph

c)

Weighted

d)

Digraph

21.

 Describe the method that would need to be followed to attempt to remove an item from a circular queue implemented as a static data structure using an array.

Your method should deal appropriately with any issues which could arise - 4 marks

4 lines
22.

What value will be returned by applying the peek operation to S?

a)

Jib

b)

Skye

c)

Harry

d)

None

23.

What value will be returned by applying the pop operation to S?

a)

Jib

b)

Skye

c)

Harry

d)

None

24.

Explain how a single stack can be used to reverse the order of the items in a queue. - 2 marks

4 lines
25.

Describe the steps involved in adding an item to a linear queue that has been implemented as a static data structure using an array. Your answer should include a description of how any pointers are used and changed. - 3 marks

4 lines
26.

Complete the unshaded table

27.

State one reason why the graph shown in Figure 1 is not a tree.

4 lines
28.

Instead of using an adjacency matrix, an adjacency list could be used to represent the graph. Explain the circumstances in which it would be more appropriate to use an adjacency list instead of an adjacency matrix. - 2 Marks

4 lines