Professional Documents
Culture Documents
2. A sparse matrix is a matrix whose most of the elements are zeros. Storing a sparse matrix
using a two-dimensional array is waste of memory; instead, we can store each non-zero cell
value as a triplet <row, column, value> in a linked list.
Define a self referencing structure to store a non-zero element of a sparse matrix. Define
the following functions to perform operations on sparse matrices.
Read matrix’s non-zero elements from the user and creates a linked lists as
mentioned.
Addition of two sparse matrices
3. Write a simple application to conduct a computer based quiz. The quiz consists of questions
with answers true or false only. Suppose the questions are present in a text file
Questions.txt, in the following format:
Each odd line of the file consists of a question, and the immediate even line consists of the
answer (“true” or “false”).
Your program should display questions one by one, and prompt the user to enter his
answer, at the end display the score of the user. And also display the questions the user has
wrongly answered along with the correct answer. (You can assume that maximum of 20
questions are there in the file and each question is of length at most 80 characters).
A sample Questions.txt file:
There are one thousand years in a CENTURY.
false
DOZEN is equivalent to 20.
false
The past tense of FIND is FOUND.
true