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]
2 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]2 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
A command, such as a button or keyboard shortcut, that performs a specific task is known as a
Oxana [17]

Answer:

Macro

Explanation:

7 0
3 years ago
Read 2 more answers
.Write a MATLAB script that VECTORIZES (eliminates the loop) the following code. (4points)
gladu [14]

Answer:

Explanation:

try

clc

clear

close all

x=linspace(0,2*pi,7);

z=cos(pi.*x./3)

% the output on mine is to 4 decimals so it looks a bit different than what the output on your example is , but, I think if you change the format to decimal 2 it will look the same  :)

4 0
2 years ago
Create a medical report for Wellness Hospital. Mention the hospital name as the heading and the report name as the subheading. T
IrinaK [193]

Some things to consider when preparing a medical report are:

  1. Informed consent of the patient
  2. Physical examinations of the patient
  3. Background information
  4. Obtained specimens
  5. Medical history, etc.

<h3>What is a Medical Report?</h3>

This refers to the very detailed report that contains an account of a person's full clinical history.

Therefore, a sample medical report is given below:

  • Name of Hospital: Mellview Hospital
  • Address: 27, Hemingway Close, London
  • Gender: Male
  • Name: Oscar Pedrozo
  • HIV test, Malaria test, High Blood Pressure, etc.

Read more about medical reports here:

brainly.com/question/21819443

#SPJ1

5 0
2 years ago
Unless you explicitly initialize global variables, they are automatically initialized to
shusha [124]

Answer:

Zero(0)

Explanation:

<u>Global Variables </u>

Variables which are declared outside any function. Any function can use these variables,they are automatically initialized to zero(0).They are generally declared before main() function.

Example- C program for showing global variable is 0.

  #include <stdio.h>

   int g;  // declaring g as global variable

   int main()

   {

       printf("%d",g);  //printing global variable

       return 0;

    }

<u>Output</u>

  0

4 0
3 years ago
Give 3 reasons why it is believed that smart phones precent us from communicating face to face.give three reasons why it is beli
gregori [183]

Answer:

yes

Explanation:

because the people will be lazy to go and talk to that person instead They will call each other and discuss

7 0
1 year ago
Other questions:
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • What is 8 hours, 5 minutes, 22 seconds minus (-) 7 hours, 24 minutes, 37 seconds?
    6·1 answer
  • Susan has always wanted to be a veterinarian. When doing her research, she answers all self-assessments geared toward that caree
    13·1 answer
  • Optimizing a PC’s performance often involves utilities that can defragment disks, clean a system’s Registry, scan for malware, r
    14·1 answer
  • The term ____ describes primary storage devices that are implemented as microchips, can read and write with equal speed, and can
    8·1 answer
  • Which HTML tag is used to add a paragraph to a web page?
    15·1 answer
  • What direction would a sprite go if you constantly increased its x property? Your answer What direction would a sprite go if you
    7·1 answer
  • In attempts to improve their contribution to the environment a company decides to adapt green computing. Which of these techniqu
    13·1 answer
  • If a system contains 1,000 disk drives, each of which has a 750,000- hour MTBF, which of the following best describes how often
    15·1 answer
  • Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!