Skip to content
VUBuddy

CS502 Assignment 2 Solution

Fundamentals of Algorithms PDF 211 KBUpdated 23 Oct 2026
Assignment CS502 Assignment 2 Solution PDF 211 KB
vubuddy.com
Type
Assignment
Course
CS502 Fundamentals of Algorithms
Size
PDF 211 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 211 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 4 of 4. Download the file for all 4 pages.

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 and Technology N

Shaheed Zulfikar Ali Bhutto Institute of Science and Technology S

Virtual University of Pakistan V Table 1: Islamabad Institutes CS502-Fundamentals of Algorithms Total marks = 20 Assignment No.2 Solution Deadline Semester: SPRING 2023

12th of July 2023 · NOTE · Don't copy-paste the same answer.

Make sure you can make some changes to your solution file before submitting copy paste solution will be marked zero.

If you found any mistake then correct yourself and inform me.

Before submitting an assignment/GDB check your assignment requirement file.

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.

Figure 2: Graph Representation

F · N · I · V · B · S · A · C · F · N · I · V · B · S · A · C · Your Task 2:

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

Solution:

Every assignment/GDB is change due to unique Student ID so Don’t Copy

That is truly perfect step by step idea solution get help easily.

By The Way if there is any Mistake you found, correct it yourself First Then Submit.

All CS502 files →
CS502 Fundamentals of Algorithms All CS502 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.