0% found this document useful (0 votes)
8 views

DS-Assignment 1

Uploaded by

abdullshahbaz2
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

DS-Assignment 1

Uploaded by

abdullshahbaz2
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

University of Central Punjab

Faculty of Information Technology and Computer


Science

Course Title: Discrete Structures


Course Code: AL-143

Assignment 1

Name: _______________________________

Registration Number: ___________________

Section: ______________________________

CLO # Course Learning Outcome (CLO) Taxonom Mappi


y Level ng to
PLO
CLO 3 The students will be able to illustrate the C3 PLO 2
application of mathematical ideas like
graphs and trees to computer science
problems.

Instructions:
1. Attempt all questions.
2. Write your answer showing all steps required to perform the task.
3. Assignment should be submitted on A4 sheets or Assignment sheets only. Violation
will result to deduction of 1 mark from the scored marks.
4. Each student will have attached this front page with his/her assignment. Violation
will result to deduction of 1 mark from the scored marks.
5. Due Date for Assignment is November 12, 2024.
6. Late submission will result in 10% deduction in marks.
7. No request for late submissions will be considered after two working days of the
deadline.
8. No request to review assignment will be considered after 2 working days of the
review in class.
Assignment 1: Sets in Discrete Mathematics, Dijkstra’s Algorithm, and Kruskal’s Algorithm

Part 1: Sets in Discrete Mathematics

1. Theory Questions:

o Define the following terms related to sets:

 Power Set

 Cartesian Product

 Union, Intersection, and Complement of Sets

o What is a universal set? How is it used in set theory?

o Explain disjoint sets with an example.

o Discuss Venn diagrams and how they represent relationships between sets.

2. Problems:

o Given sets A = {1, 2, 3, 4} and B = {3, 4, 5, 6}:

 Find A ∪ B and A ∩ B.

 Determine A - B and B - A.

o Let C = {x | x is an even integer between 1 and 10}. Find the power set of C.

o If U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A = {2, 4, 6, 8}, and B = {3, 4, 5, 6}:

 Use Venn diagrams to illustrate A ∪ B, A ∩ B, and the complement of A ∪ B


within U.

Part 2: Dijkstra's Algorithm

1. Theory Questions:

o Explain Dijkstra’s algorithm. How does it find the shortest path in a graph?

o In what type of graphs is Dijkstra's algorithm applicable? Discuss any limitations of


the algorithm.

2. Problems:

o Given a directed graph with nodes A, B, C, D, and E and the following edge weights:

 A to B = 2

 A to C = 4

 B to C = 1
 B to D = 7

 C to D = 3

 D to E = 1

o Use Dijkstra’s algorithm to find the shortest path from A to E. Show each step,
including updates to distances and paths.

Part 3: Kruskal’s Algorithm

1. Theory Questions:

o Describe Kruskal’s algorithm. What is it used for?

o Explain the concept of a minimum spanning tree (MST). Why is finding an MST
useful?

o How does Kruskal's algorithm avoid creating cycles in the MST?

2. Problems:

o Given the undirected graph below with nodes A, B, C, D, and E and the following
edge weights:

 A-B=4

 A-C=2

 B-C=1

 B-D=5

 C-D=3

 C-E=4

 D-E=2

o Use Kruskal’s algorithm to find the minimum spanning tree of the graph. Show each
step, including edge selections and updates to the union-find data structure.

You might also like