Write the function that adds the two matrices

Assignment Help C/C++ Programming
Reference no: EM132808577

Question 1: Write code to complete a program (download it from Stream) that reads in two sparse matrices from *.txt files and stores them as linked lists (dynamic memory). Use either the c or cpp start-up code available on Stream. The prototype reads text files in a specific format, with the first lines indicating the number of rows and columns (see example on Stream).

Write the function that adds the two matrices together and produce a result matrix. The result matrix must also be stored as a linked list. We are assuming that the matrices are too large to fit into memory as arrays, thus all calculations must be carried out with the matrices stored in their linked list format.

Write a display function that shows all three matrices in the usual matrix format.

Write a display function that shows all three linked lists in order of elements.

Note 1: The programs should read the matrices from the *.txt files, NOT from keyboard. Use the sample codes provided on Stream. Use either the C or the C++ style (both files provided on Stream).

Note 2: Make sure that values of zero are not nodes in the linked list (after all, that's the point in implementing the sparse matrix code!).

Note 3: The output must be in this format. This example has 4x4 matrices:

Matrix 1: 1 2 3 4 5

0 1 0 0 0 0 2 0 0 3 0 4 0 0 0 5 Matrix 2: 1 1 2 3 4 10 3 3

1 1 2 0 0 0 3 0 0 4 0 10 0 0 3 3 Matrix Result: 1 2 2 5 7 14 3 8

1 2 2 0 0 0 5 0 0 7 0 14 0 0 3 8

If the matrix is all zeros, it should be printed like this, indicating that the corresponding linked-list is empty:

Matrix 2:

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

Attachment:- GivenCode.rar

Reference no: EM132808577

Questions Cloud

BSBCUS501 Manage quality customer service Assignment : BSBCUS501 Manage quality customer service Assignment Help and Solution, Australian Health and Management Institute - Assessment Writing Service
Develop proposal for health reform : Compare and contrast the role of finance and economics in the management of health systems in the U.S. and international markets.
Spacecraft subsystems : Pick one of the following spacecraft subsystems. What is the future of technological improvements?"
Determine what changes are occurring in economy : Determine what changes are occurring in the economy or concerning labor and regulatory factors that must be considered in the future.
Write the function that adds the two matrices : Write a display function that shows all three matrices in the usual matrix format - Write a display function that shows all three linked lists
Healthcare information management : Tasks: Identify performance improvement issues based on the description of the issue and provide a brief description.
What do you think of team bonus plans : Some companies pay employees by pay grade for specific positions, i.e. G4 (scale G1-G9) and not by experience. In other words, an employee with 2 years of exper
Determine the important issue at the workplace : 1. Why is diversity management considered as an important issue at the workplace?
Community supervision strategy : The Hawaii Opportunity Probation with Enforcement (HOPE) is a community supervision strategy for substance-abusing probationers.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd