Write a function to delete an element from a given position in the sparse matrix representation of
Question:
Write a function to delete an element from a given position in 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% (2 reviews)
The image you provided explains how a lower or upper triangular matrix can be represented in a condensed form to save space when coding This form of s...View the full answer
Answered By
Utsab mitra
I have the expertise to deliver these subjects to college and higher-level students. The services would involve only solving assignments, homework help, and others.
I have experience in delivering these subjects for the last 6 years on a freelancing basis in different companies around the globe. I am CMA certified and CGMA UK. I have professional experience of 18 years in the industry involved in the manufacturing company and IT implementation experience of over 12 years.
I have delivered this help to students effortlessly, which is essential to give the students a good grade in their studies.
3.50+
2+ 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 add an element at a given position to 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...
-
Explain fully the role played by unplanned investment in inventories in determining equilibrium in the Keynesian model. Use the examples of AD > GDP and AD < GDP to illustrate your answer.
-
Helium in a piston/cylinder at 20C, 100 kPa is brought to 400 K in a reversible polytropic process with exponent n = 1.25. You may assume helium is an ideal gas with constant specific heat....
-
Describe the pros and cons of quantity discount-based promotions from a retailer's perspective.
-
Describe the factors that affect the design of organizational structures. (pp. 294296)
-
After hearing a knock at your front door, you are surprised to see the Prize Patrol from a large, well-known magazine subscription company. It has arrived with the good news that you are the big...
-
A company purchased new equipment for $73,000. The company paid cash for the equipment. Other costs associated with the equipment were: transportation costs, $1,650; sales tax paid $5,600; and...
-
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...
-
Each month the cost of accumulated depreciation grows while the cost of equipment goes up. Agree or disagree. Defend your position.
-
2.11.2Project:Performance Task: The Parallax Problem Project Geometry Sem 1 (S3537251) Julio Duenas Points possible:120 Date: ____________ The Scenario:You're looking for a sponsor to pay for you to...
-
If the most common treatment of assigning overapplied overhead was used, the final balance in Cost of Goods Sold would have been * (1 Point) At the end of the last fiscal year, BREAD Company had the...
-
Angelina received new word processing software for her birthday. She also received a cheque with which she intends to purchase a new computer. Angelina's UNILUS Professor assigned a paper due in two...
-
At date t, the portfolio P to be hedged is a portfolio of Treasury bonds with various possible maturities. Its characteristics are as follows: Value YTM MD Convexity $1,450 6% 4.25 55 We consider...
-
A playground merry-go-round with an axis at the center (radius R = 1.3 m and rotational inertia | = 1.2 x 103 kgm2) is initially rotating at angular velocity w = 0.21 rad/s clockwise). A girl of mass...
-
Reconsider Prob. 7-89. Using EES (or other) software, investigate the effect of the final pressure on the final mass in the tank as the pressure varies from 450 to 150 kPa, and plot the results....
-
A liquid flows upward through a valve situated in a vertical pipe. Calculate the differential pressure (kPa) between points A and B. The mean velocity of the flow is 4.1 m/s. The specific gravity of...
-
Is t possible for an application to enjoy reliable data transfer even when the application runs over UDP If so, how?
-
In our rdt protocols, why did we need to introduce sequence numbers?
-
Consider the rt2.2 receiver in Figure 3.14, and the creation of a new packet in the se1f-ansition (i.e., the transition from the state back to itself) in the Waifor-0-from-below arid the...
-
ABC Company engaged in the following transaction in October 2 0 1 7 Oct 7 Sold Merchandise on credit to L Barrett $ 6 0 0 0 8 Purchased merchandise on credit from Bennett Company $ 1 2 , 0 0 0 . 9...
-
Lime Corporation, with E & P of $500,000, distributes land (worth $300,000, adjusted basis of $350,000) to Harry, its sole shareholder. The land is subject to a liability of $120,000, which Harry...
-
A comic store began operations in 2018 and, although it is incorporated as a limited liability company, it decided to be taxed as a corporation. In its first year, the comic store broke even. In...
Study smarter with the SolutionInn App