Académique Documents
Professionnel Documents
Culture Documents
An Upper Triangular Matrix is one of the classifications of sparse matrix that is populated
primarily with zeros, and only a small number of its elements have non-zero value.
The standard representation of a matrix in computer science is a two-dimensional array. While
representing such matrices, memory organization plays a vital role as all the elements would not
be used to store the data in matrix array all times. Hence, consideration of an alternate forms of
representation for such matrices is required.
Fig. 1. Sparse
Matrix Example of Pointer to the next non-all-zero row of
size 10 x 10 the matrix
Fig. 2. Sparse Matrix Represented using
Linked Nodes
You are required to write a C++ program that implements the given upper triangular matrix data
structure, with the following functionalities:
3. Input function to allow user to input the non-zero elements of the matrix:
void displayElements ( ) { … }
- reads only the non-zero elements from the user, and properly fills in the
corresponding nodes, and links them correctly. User should keep inputting arbitrary
[row index, column index, and value] triples, with proper indicator to stop input
process.
Assignment Requirements
You are required to submit a hardcopy as well as a softcopy of assignment report and
source code. The report should contain:
- Detailed explanation of the data structures and classes created, with proper justification
on your decisions (include source code defining classes, data members, and method
headers only).
- Brief explanation about the algorithms used to implement functionalities 2, 3, 4, 5, and
6 above (include code snippets of important parts of implementation).
- Source code of the main function, with screenshots showing program’s input and
output interactions.
You have to present your assignment solution and answers to the lecturer during Q&A
session that will be conducted after hand-in date.
If you use some code which has been taken or adapted from another source (book,
magazine, internet, forum, etc.) then this must be cited and referenced using Harvard
Referencing Style within your source code, and this must be mentioned explicitly in the
report. Failure to reference code properly will be treated as plagiarism.
Automated tools for checking code similarities among submissions will be used, and all
detected cases will be treated as cheating.
1. You are required to hand in the individual assignment report on or before the due
date mentioned on the cover sheet of the assignment.
2. The attached CD should include a softcopy of the report, in addition to the C++
files of the programs. The organization of files and folders must adhere to the
following instructions precisely:
A folder named “StudentFirstName-StudentID-Asmnt” should contain the report
file (Microsoft Word), and the C++ (*.cpp / *.h) files ONLY. All additional project
files (especially if you use Visual Studio) should be removed.
Make sure to DELETE all non-source-code files, including executables (*.exe).
3. A zipped file containing CD content and named “StudentFirstName-StudentID-
Asmnt.zip” should be emailed to the lecturer at
syedmohdzahid@staffemail.apu.edu.my on submission day itself. The email
subject field MUST be set to: DSTR Assignment - Full Name - StudentID. Failing
to send the email on time, or not following the given guidelines will be considered
as no submission.
4. You should present an executable solution during Q&A session to demonstrate
program execution, the working of the data structure, your understanding of the
code, and ability to modify / fix it.
5. You have to submit your assignment with Coursework Submission and Feedback
Form (CSFF) attached.
Marking Criteria:
The program submitted will be evaluated according to the following performance criteria: