DS-Assignment 1
DS-Assignment 1
Assignment 1
Name: _______________________________
Section: ______________________________
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
1. Theory Questions:
Power Set
Cartesian Product
o Discuss Venn diagrams and how they represent relationships between sets.
2. Problems:
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.
1. Theory Questions:
o Explain Dijkstra’s algorithm. How does it find the shortest path in a graph?
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.
1. Theory Questions:
o Explain the concept of a minimum spanning tree (MST). Why is finding an MST
useful?
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.