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
Is it possible to do Agile project in Waterfall methodology?
MariettaO [177]
Yes, it could be possilbe
5 0
3 years ago
Read 2 more answers
how many usable host addresses are available for each subnet when 4 bits are borrowed from a class C IP address
jonny [76]

Answer:

The answer is "14".

Explanation:

Let the IP address = 196.45.204.0

When it borrowed 4 bits

\therefore\\\\ subnet = 28

IP=  \frac{196.45.204.0}{28}\\\\ 28 \to 11111111.11111111.11111111.11110000

If the borrowed bits are left out then:

The Number of useable host addresses:

= {(2^4) - 2} \\\\ = 16-2\\\\ =14

3 0
2 years ago
When the narrator of "EPIC 2015" describes the year 2015 as the "worst of
denpristay [2]

Answer:

A. computers will be replaced by new technology

3 0
2 years ago
a flow chart is the _______ representation of the sequence of steps required of steps required to solve a particular problem​. I
Eddi Din [679]

Answer:

A flowchart is simply a graphical representation of steps. It shows steps in sequential order and is widely used in presenting the flow of algorithms, workflow or processes. Typically, a flowchart shows the steps as boxes of various kinds, and their order by connecting them with arrows.

7 0
3 years ago
You typed the word "weather" when you meant to type the word "whether." When will Writer or Word flag this as a misspelling or a
maria [59]

Answer:

It depends on the structure of the sentence.

Explanation:

This will be shown as grammatical mistake because both the spellings are correct. If we write the word weather instead of the whether, Ms word shows the grammatical mistake. This is because, if we want to write the word whether, we should use or in our sentence. Both of these words are comes together.

Example

I will take a leave whether its raining or not.

In above sentence, both whether and or comes together. If we write weather instead of whether it just show the grammatical mistake in the sentence.

4 0
3 years ago
Read 2 more answers
Other questions:
  • When saving a memo you created in Word, which one of the following extensions is automatically assigned to the document?
    13·1 answer
  • WILL GIVE BRAINLIEST! I'm doing a project at school. Does anyone have any good explanations for Digital Art? I need it to be at
    13·2 answers
  • Dylan, an interior designer, has sketched out a layout for a client's living room. He wants the client's approval of the layout
    11·2 answers
  • From your computer you are able to establish a telnet connection to a remote host but a traceroute to the host IP address result
    6·1 answer
  • what type of machine is a ramp for wheelchairs? compound machine, mechanical, machine complex machine, simple machine
    15·2 answers
  • What is something that can be done to help stop teen teen crashes
    8·1 answer
  • Discuss at least 1 Microsoft Windows security features that could protect data?
    5·1 answer
  • Another way to create a new presentation is from the Home tab
    6·2 answers
  • Raw materials have two basic types what are the 2?
    11·2 answers
  • What line of business (L'Oréa)?​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!