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% (1 review)
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....
-
Write pseudocode agent programs for the goal-based and utility-based agents. The following exercises all concern the implementation of environments and agents for the vacuum-cleaner world.
-
In 2010, in an attempt to increase the number of Americans covered by health insurance and reduce the cost of health care, Congress passed the Patient Protection and Affordable Care Act. A key...
-
The mean preparation fee H&R Block charged retail customers last year was $183 (The Wall Street Journal, March 7, 2012). Use this price as the population mean and assume the population standard...
-
Discuss how a good understanding of the state of the economy might help you make better decisions. Discuss how much of a role you think a government should play in a market system. Explain how you...
-
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...
-
Find the radius of convergence and interval of convergence of the series.
-
Compare the accounts payable balance from the supplier aged summary to the balance from the trial balance. Create a note on the account in CaseWare that these amounts match. Finnigan filed the June...
-
In your own words, briefly compare the Army Air Corps with the modern Air Force (you may need to do light research). Do you feel there exist rivalries among the pilots of the various armed forces?...
-
1). Compare the business process at AuthBridge in its early days with that in 2011. How has the process evolved? 2). What is the impact of the digitalization on throughput rate, throughput time, and...
-
Supply chain case study - Demise of K-mart. Please compare the supply chain of K-mart, Walmart and Target Identification of Business Strategy in Supply Chain Management of K-mart, Walmart, and Target...
-
A peer group analysis is a way to compare financial statements of similar companies/business to each other. By comparing the two different financial statements they evaluate the performance of each...
-
The stock price of Retro Co. is $65. Investors required a 12 percent rate of return on similar stocks. If the company plans to pay dividend of $3.80 next year, what growth rate is expected for the...
-
Use multiplication or division of power series to find the first three nonzero terms in the Maclaurin series for each function. y = e x2 cos x
-
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...
-
Consider the following functions for problems 1 and 2. void selectionSort (int array[]) { sort (array, 0); } void sort (int[] array, int i) { if (i
-
Using the information given here, what is the price-earnings ratio for DEF Company?) Earnings $100,000 Number of shares outstanding = 50,000 Share price = $40 Book value per share = $8
-
How do database management systems handle referential actions, such as ON DELETE and ON UPDATE clauses, in the context of foreign key constraints, and what are their implications for data management ?
Study smarter with the SolutionInn App