1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Delvig [45]
3 years ago
11

What are the pros and cons of using a linked implementation of a sparse matrix, as opposed to an array-based implementation?

Computers and Technology
1 answer:
otez555 [7]3 years ago
6 0

Answer:

Linked lists and arrays are both linear data structures but while an array is a collection of items that can be accessed randomly, a linked list can be accessed sequentially.

A sparse matrix contains very few non-zero elements. For example;

_                        _

|  0   0   3  0  6    |

|   0   5   0  0  4   |

|   2   0   0  0  0   |

|_ 0   0   0  0  0 _|

In the implementation of a sparse matrix, the following are some of the pros and cons of using a linked list over an array;

<em>PROS</em>

i.  Linked lists are dynamic in nature and are readily flexible - they can expand and contract without having to allocate and/or de-allocated memory compared to an array where an initial size might need to be set and controlled almost manually. This makes it easy to store and remove elements from the sparse matrix.

ii. No memory wastage. Since the size of a linked list can grow or shrink at run time, there's no memory wastage as it adjusts depending on the number of items it wants to store. This is in contrast with arrays where you might have unallocated slots. Also, because the zeros of the sparse matrix need not be stored when using linked lists, memory is greatly conserved.

<em>CONS</em>

i. One of the biggest cons of linked lists is the difficulty in traversing items. With arrays, this is just of an order of 0(1) since the only requirement is the index of the item. With linked lists, traversal is sequential which means slow access time.

ii. Storage is another bottle neck when using linked lists in sparse matrix implementation. Each node item in a linked list contains other information that needs to be stored alongside the value such as the pointer to the next or previous item.

You might be interested in
Definition of my computer​
RideAnS [48]

Answer:

a programmable electronic device designed to accept data

Explanation:

a programmable electronic device designed to accept data

8 0
3 years ago
Read 2 more answers
Which best describes the Quick Access toolbar and the ribbon tabs?
Nady [450]

Answer: D

Explanation: The Quick Access Toolbar is customizable, and the Ribbon tabs are collapsible.

4 0
3 years ago
Read 2 more answers
Use the drop-down menus to complete the statements.
damaskus [11]

Answer:

data source

copied and pasted

Explanation:

corctEdgbuz

5 0
3 years ago
Help me Please?!! I will put you as brainliest.<br>I hope I spelled that right.
ser-zykov [4K]

Answer:

First finger I remember this on my test

Explanation:

6 0
3 years ago
Read 2 more answers
In this problem, we explore some of the properties of the CRC. For the generator G (=1001) given in Section 5.2.3, answer the fo
allochka39001 [22]

Answer:

b

Explanation:

5 0
4 years ago
Other questions:
  • Write a pyhton program to calculate area of a circle?
    12·1 answer
  • The initial step of the five-step problem-solving model is to: A. Explore alternatives B. Clarify values. C. Develop an approach
    9·1 answer
  • Which of these is an effective color scheme?
    14·1 answer
  • What is systems integration?
    12·1 answer
  • Understanding the intended audience of a media piece will help the reader :
    5·1 answer
  • Create a trigger that prevents anychange(insert, update, or delete)to the grade attribute of the takesrelation that would change
    14·1 answer
  • Select the statements that are true regarding the future of technology. Select 2 options.
    12·1 answer
  • 1. Some of the music in the 1960s was used to protest social and political issues. Is music still used as a form of protest? Why
    13·1 answer
  • What is the capacity of a disk with two platters, 10,000 cylinders, an average of 400 sectors per track, and 512 bytes per secto
    9·1 answer
  • Which of the following best describes a hotspot as
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!