Name: ___________________ Registration Number: ______________
University of Management and Technology (UMT)
School of Systems and Technology (SST)
Department of Computer Science
Course: Data Structures and Algorithms (CC-2042)
Quiz Number 1
Date: November 18, 2024.
Semester: Fall-2024
Maximum Marks: 40
Time: 40 min
Instructor: Dr Bilal Ashfaq Ahmed
Advice to Student
1. Carefully read question and ensure you understand what is being asked
before starting your solution.
2. Include comments in your code to explain your logic and steps.
You are given two singly linked lists that may or may not intersect. Two linked lists
intersect if they share a common node, meaning they merge at some point and thereafter
share all their nodes. The shared node is the same physical node in memory for both lists.
Objective: Write a C++ function that determines if two singly linked lists intersect and, if they
do, finds the node at which the intersection occurs.
Function Requirements:
1. The function should return a pointer to the intersecting node or nullptr if there is no
intersection.
Best of Luck
1
University of Management and Technology (UMT)
School of Systems and Technology (SST)
Department of Computer Science
Course: Data Structures and Algorithms (CC-2042)
Quiz Number 1
Date: November 18, 2024.
Semester: Fall-2024
Maximum Marks: 40
Time: 40 min
Instructor: Dr Bilal Ashfaq Ahmed
Advice to Student
1. Carefully read question and ensure you understand what is being asked
before starting your solution.
2. Include comments in your code to explain your logic and steps.
You are given two singly linked lists that may or may not intersect. Two linked lists
intersect if they share a common node, meaning they merge at some point and thereafter
share all their nodes. The shared node is the same physical node in memory for both lists.
Objective: Write a C++ function that determines if two singly linked lists intersect and, if they
do, finds the node at which the intersection occurs.
Function Requirements:
1. The function should return a pointer to the intersecting node or nullptr if there is no
intersection.
Best of Luck
1