Write a function to add an element at a given position to the sparse matrix representation of
Question:
Write a function to add an element at a given position to the sparse matrix representation of Section 12.2.
Transcribed Image Text:
12.2 Matrix Representations Some applications must represent a large, two-dimensional matrix where many of the elements have a value of zero. One example is the lower triangular matrix that results from solving systems of simultaneous equations. A lower triangular matrix stores zero values at positions [r, c] such that r < c, as shown in Figure 12.6(a). Thus, the upper-right triangle of the matrix is always zero. Another example is the representation of undirected graphs in an adjacency matrix (see Project 11.2). Because all edges between Vertices i and j go in both directions, there is no need to store both. Instead we can just store one edge going from the higher-indexed vertex to the lower-indexed vertex. In this case, only the lower triangle of the matrix can have non-zero values. We can take advantage of this fact to save space. Instead of storing n(n+1)/2 pieces of information in an n x n array, it would save space to use a list of length n(n+1)/2. This is only practical if some means can be found to locate within the list the element that would correspond to position [r, c] in the original matrix. To derive an equation to do this computation, note that row 0 of the matrix has one non-zero value, row 1 has two non-zero values, and so on. Thus, row r is preceded by r rows with a total of 1k = (r + r)/2 non-zero elements. Adding c to reach the cth position in the rth row yields the following equation to convert position [r, c] in the original matrix to the correct position in the list. matrix[r, c] = list [(r +r)/2+c]. A similar equation can be used to store an upper triangular matrix, that is, a matrix with zero values at positions [r, c] such that r>c, as shown in Figure 12.6(b). For an n x n upper triangular matrix, the equation would be matrix[r, c] = list[rn - (r +r)/2+c].
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (3 reviews)
The image provided describes a way of storing and accessing elements of lower and upper triangular matrices to save space For a lower triangular matri...View the full answer
Answered By
AJIN kuriakose
I have completed B.Tech in Electrical Engineering & Masters in Power & Control From one of the best universities in India. I got the 99.05 percentile in the Gate Electrical Engineering Exam. I can Help students solving assignments in Electrical subjects like Power Electronics, Control system, Analog, Network Theory & Engineering Mathematics. Clear your fundamentals and develop problem-solving skills and analytical skills to crack the exam.
Get guidance and the opportunity to learn from experienced...
I can provide tuition for Electrical engineering subjects (Power Electronics, Digital electronics, Network Theory, Control System & Engineering Mathematics). The toughest subject of Electrical engineering can be made simple in online classes...
I can also solve it.
1 .I can help you with your assignments or exams or quiz or tutoring.
2. Very strict to the deadlines.
Message me for any help in assignments, live sessions. I am here to help students for all assignments, tests and exams and I will make sure you always get _95% In your subject.
Contact me in solution inn for any help in your semester, projects and for many more things . Also feel free to contact me through solution inn and for any advise related to tutoring and how it works here.thank you.
5.00+
5+ Reviews
10+ Question Solved
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Question Posted:
Students also viewed these Computer science questions
-
What are required skills for a good negotiation? Pros and cons for using such a mechanism. Choose a IT work-based scenario and explain whether you would use negotiation or not? Use relevant...
-
Write a function to delete an element from a given position in the sparse matrix representation of Section 12.2. 12.2 Matrix Representations Some applications must represent a large, two-dimensional...
-
Implement the sparse matrix representation of Section 12.2. Your implementation should support the following operations on the matrix: Insert an element at a given position, Delete an element from...
-
Miller Companys contribution format income statement for the most recent month is shown below: Total Per Unit Sales (41,000 units) $ 287,000 $ 7.00 Variable expenses 164,000 4.00 Contribution margin...
-
The power stroke in an internal combustion engine can be approximated with a polytropic expansion. Consider air in a cylinder volume of 0.2 L at 7 MPa, 1800 K. It now expands in a reversible...
-
Discuss the concept of trading-area overlap from the perspective of small- versus large-store formats.
-
List and define common contemporary organizational structures. (pp. 294296)
-
An economist reports that 560 out of a sample of 1,200 middle-income American households actively participate in the stock market. a. Construct the 90% confidence interval for the proportion of...
-
ACC - 1 5 4 - 0 0 1 - Prin Managerial Acctg Christian Khezeran 0 3 / 2 8 / 2 4 6 : 1 7 PM Homework: Chapter 8 HW Question 5 , P 8 - 5 8 A ( similar to ) HW Score: 3 5 . 7 % , 3 . 5 7 of 1 0 points...
-
Write a function to transpose a sparse matrix as represented in Section 12.2. 12.2 Matrix Representations Some applications must represent a large, two-dimensional matrix where many of the elements...
-
What fraction of the values in a matrix must be zero for the sparse matrix representation of Section 12.2 to be more space efficient than the standard two-dimensional matrix representation when data...
-
What is a constant growth stock? How are constant growth stocks valued?
-
The current rate of interest on S-T Treasury Bills = 10%, intermediate term Gov. Bonds = 11%, Lt- Gov. Bonds = 12%, AA rate Corp. Bonds = 13.5% and the rate of inflation is 5%. Holding-period returns...
-
Prepare Income Statement(absorption costing) for the second, third and fourth month. SALES (SP X unit sold) INCOME STATEMENT FORMAT (ABSORPTION COSTING) XXX Less: Cost of Goodsold VARIABLE COST (VC...
-
The following shows the distribution of final exam scores in a large introductory psychology class. The proportion under the curve is given for two segments (short answers-no calculations required)....
-
How much overhead was included in the cost of Job #461 at the beginning of January? * (1 Point). BREAD Co. uses a job order costing system. At the beginning of January, the company had 2 jobs in...
-
3. (3pt.) A state of a physical system is just a description of the system at an instant in time in terms of its properties. In classical mechanics, states are represented by points (in phase space)....
-
Work is entropy free, and sometimes the claim is made that work will not change the entropy of a fluid passing through an adiabatic steady-flow system with a single inlet and outlet. Is this a valid...
-
The Smiths buy a house. They borrow 80 percent of the purchase price from the local ABC Savings and Loan. Before they make their first payment, ABC transfers the right to receive mortgage payments to...
-
Visit the Go-sack-N Java applet at the companion Web site. a. Have the source send five packets, and then pause the animation before any of the five packets reach the destination. Then kill the first...
-
A packet flow is said to conform to a leaky bucket specification (r, b) with burst size b and average rate r if the number of packets that arrive to the leaky bucket is less than n + b packets in...
-
a. Consider an audio conference call in Skype with N > 2 participants. Suppose each participant generates a constant stream of rate r bps. How many bits per second will the call initiator need to...
-
Palisade Creek Co. is a merchandising business that uses the perpetual inventory system. The account balances for Palisade Creek Co. as of May 1, 2019 (unless otherwise indicated), are as follows:...
-
1-When accounting for an acquisition, goodwill is the difference between what two things? 2- What factors should be considered when deciding whether an acquisition should be financed with cash or...
-
What is the main friction Fluidity aims to address? REAL STATE
Study smarter with the SolutionInn App