0% found this document useful (0 votes)
2 views1 page

Lab Asignment 1

The document outlines a lab assignment for COMSATS University students in the Department of Computer Science, due on April 7, 2025. Students are required to implement a system in C++ to manage sparse flight data using a linked list representation of a sparse matrix, focusing on operations such as storing flight data, transposing the matrix, adding and multiplying flight matrices. Additionally, students must provide a diagrammatic representation of each important step and a function to print the matrix in a readable format.

Uploaded by

Shaheer Qureshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Lab Asignment 1

The document outlines a lab assignment for COMSATS University students in the Department of Computer Science, due on April 7, 2025. Students are required to implement a system in C++ to manage sparse flight data using a linked list representation of a sparse matrix, focusing on operations such as storing flight data, transposing the matrix, adding and multiplying flight matrices. Additionally, students must provide a diagrammatic representation of each important step and a function to print the matrix in a readable format.

Uploaded by

Shaheer Qureshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

COMSATS University, Islamabad

Islamabad Campus
Department of Computer Science
Must be hand written due date:07-April-25 11:50AM
Lab Assignment-1:
CLO-4: SO(2,3,4): Implement linear’s non-linear data structures, sorting s searching
algorithms and hashing.

What to do:
Implement the given tasks in C++ language.
Diagrammatically show the impact of each important step.

You are working for a company that manages flight data for multiple airports. The
company stores information about flights between different airports, but only a small
percentage of the potential routes between these airports have actual flights, making the
data sparse. You need to implement a system to efficiently store, manipulate, and process
this sparse flight data using a sparse matrix represented as a linked list. Each entry in the
sparse matrix will store the number of flights between two airports (represented by rows
and columns of the matrix). The system should store only non-zero values (i.e., existing
flights), as the majority of routes have no flights.

Implement the following operations:


1. Store flight data: Input and store only non-zero entries in the matrix using a linked list.
2. Transpose the flight matrix: Implement a function to transpose the matrix, where
rows represent departure airports and columns represent arrival airports. The transpose
flips the matrix, showing flights arriving at each airport instead of departing.
3. Add flight data from two matrices: Combine the flight data for two different weeks.
Adding the flight data for two different weeks gives the total number of flights across
both weeks.
4. Multiply flight matrices: Multiply two flight matrices to analyze connecting flights
between airports via intermediate airports. This can help analyze indirect flight
connections, i.e., flights from Airport A to Airport C via Airport B. This could be useful
for determining connecting flights between airports.

Finally, write a function to print the matrix in a readable format, showing all airports and
the number of flights between them.

You might also like