You are on page 1of 3

Assignment No.

02
Total Marks: 20
SEMESTER Spring 2023
CS502- Fundamentals of Algorithms Due Date: 12/07/2023
Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit if:
 The assignment is submitted after due date.
 The submitted assignment does not open or file corrupt.
 The assignment is fully or partially copied from (other student or ditto copy from handouts or internet).
 Student ID is not mentioned in the assignment File or name of file is other than student ID.
 The assignment is not submitted in .doc or .docx format.

Uploading instructions
Your submission must include:

 Assignment should be in .doc or .docx format.


 Save your assignment with your Student ID (e.g. bx180200786.doc).
 Assignment submission through email is NOT acceptable

Objective
Here are the core objectives of this assignment:
 To understand the Graph Traversal.
 To give basic knowledge and understanding of Depth First Search (DFS) Algorithms.
 To be able to understand memory structures while using graphs.

Note:
Your answer must follow the below given specifications.
 Font style: “Times New Roman”
 Font color: “Black”
 Font size: “12”
 Bold for heading only.
 Font in Italic is not allowed at all.
 No formatting or bullets are allowed to use.
 Your answer should be precise and to the point, avoid irrelevant detail.

Lectures Covered: This assignment covers Lecture # 27 - 32


Deadline
Your assignment must be uploaded/submitted at or before 12/07/2023.
Assignment Statement:

Following table is representing some educational institutes of Islamabad in column 1 and supposed vertices of
every institute in column 2.

Institute Name Vertex


Arid Agriculture University A
Baharia University B
Comsats University C
Fast National University F
International Islamic University I
NUST (National University of Science
N
and Technology
Shaheed Zulfikar Ali Bhutto Institute
S
of Science and Technology
Virtual University of Pakistan V
Table 1: Islamabad Institutes

B V

A
S

N F C

Figure 1: Map Representation of Institutes


Your Task 1:
You are required to consider the graph given in figure 2, and perform Depth First Search by implementing the
‘bag’ using a Stack. You need to perform each trace of the DFS on the given graph and show the final DFS tree
only. You will consider the vertex V (Virtual university of Pakistan) as starting vertex.
No need to mention each trace in the solution, only final tree is required as given at Page 124 of course handouts.

I B V C

N F S A

Figure 2: Graph Representation

Your Task 2:
After creating the final DFS tree, you need to draw Adjacency List of that tree also.

For any query about the assignment, contact at CS502@vu.edu.pk

GOOD LUCK

You might also like