Lab Asignment 1
Lab Asignment 1
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.
Finally, write a function to print the matrix in a readable format, showing all airports and
the number of flights between them.