0% found this document useful (0 votes)
11 views3 pages

CNG315_Lecture10_InclassExercises

The document contains in-class exercises for an Algorithms course at Middle East Technical University, focusing on graph theory concepts such as definitions, implementations, and traversal methods. It includes true or false statements about a specific graph, as well as tasks to represent the graph using an adjacency matrix and list. Additionally, it requires the application of Depth-First and Breadth-First traversals on the graph provided.

Uploaded by

salaramir2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

CNG315_Lecture10_InclassExercises

The document contains in-class exercises for an Algorithms course at Middle East Technical University, focusing on graph theory concepts such as definitions, implementations, and traversal methods. It includes true or false statements about a specific graph, as well as tasks to represent the graph using an adjacency matrix and list. Additionally, it requires the application of Depth-First and Breadth-First traversals on the graph provided.

Uploaded by

salaramir2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MIDDLE EAST TECHNICAL UNIVERSITY, NORTHERN CYPRUS CAMPUS

CNG315 Algorithms – In-class Exercises for Lecture 10

Topics: Graphs Definitions, Graph Implementations, Depth-First Graph Traversal, Breadth-First Graph
Traversal.

1. Specify whether the following statements are True or False for the graph below.

Statements True or False


The graph is a directed graph T
The graph includes 5 vertices T
The graph has 3 edges F
ABCA is a cycle in this graph F
ABED is a simple path in this graph T
This graph is a connected graph T
This graph is a complete graph F
A is adjacent to B F
B is adjacent to A T
There is a path from D to A F

2. Represent the following graph with an adjacency matrix and adjacency list.

Page 1 of 3
3. Represent the following graph with an adjacency matrix and adjacency list.

4. Consider the following graph.

a. Apply DFT (Depth-first traversal)

Page 2 of 3
b. Apply BST (Breath-first traversal)

Page 3 of 3

You might also like