Question: Java!! (b) Write the SparseArrray method removeColumn. After removing a specified column from a sparse array: - All entries in the list entries with column
(b) Write the SparseArrray method removeColumn. After removing a specified column from a sparse array: - All entries in the list entries with column indexes matching col are removed from the list. - All entries in the list entries with column indexes greater than col are replaced by entries with column indexes that are decremented byone-(moved one column to the left). - The number of columns in the sparse array is adjusted to reflect the column removed. The sample object sparse from the beginning of the question is repeated for your convenience. The shaded entries in entries, below, correspond to the shaded column above. numRows : 6 numCols : 5 When sparse has the state shown above, the call sparse.removeColumn (1) could result in sparse having the following values in its instance variables (since entries is in no particular order, it would be equally valid to reverse the order of its two items). The shaded areas below show the changes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
