answer.
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
slava [35]
1 year ago
9

In this exercise we look at memory locality properties of matrix computation. Th e following code is written in C, where element

s within the same row are stored contiguously. Assume each word is a 32-bit integer.
for (I=0; I<8; I++)
for (J=0; J<8000; J++)
A[I][J]=B[I][0]+A[J][I];
References to which variables exhibit temporal locality?
Computers and Technology
1 answer:
Sonja [21]1 year ago
4 0

Answer:

Explanation:

temporal locality can be defined as: when a particular memory  is referenced or accessed several times  within a specific period of time. In the question, i think the variable that exhibit temporal locality are I, J and 0(all the variable). This is because the variable J and 0 are accessed several times within the loop. I would not have been part of it, but in the A[I][J]=B[I][0]+A[J][I], the variable "I" is also accessed in the addition. this is why it is part of the temporal locality.

You might be interested in
"Create a Python program named detect_column_level_data_entry_errors. When complete, you will run this program to produce a diag
11111nata11111 [884]

Answer:

See explaination

Explanation:

Code for detect_column_level_data_entry_errors.py:

# File: detect_column_level_data_entry_errors.py

# The program will produce a diagnostic report that shows data entry errors that cause column

# totals in the data to be out of balance. Will need to fix cleaned_data.txt until errors resolved.

def main():

input_filename = input('Please enter the input filename: ')

infile = open(input_filename, 'r', encoding='utf8')

total_males = 0

total_females = 0

sum_total = 0

print('\n{0:^40}'.format('Column-Level Data Entry Errors'))

print('\n{0:<10}{1:>10}{2:>10}{3:>10}'.format(

'Age Group', 'Males', 'Females', 'Total'))

for line in infile:

age_group, males, females, total = line.split()

males = int(males)

females = int(females)

total = int(total)

print('{0:<10}{1:>10,}{2:>10,}{3:>10,}'.format(

age_group, males, females, total))

if age_group != 'Total':

total_males = males + total_males

total_females = females + total_females

sum_total = total + sum_total

else:

print('{0:<10}{1:>10,}{2:>10,}{3:>10,}'.format(

'Error', (males-total_males), (females-total_females), (total-sum_total)))

infile.close()

main()

8 0
1 year ago
Which presenter would most likely benefit from a custom slide show?
PIT_PIT [208]
Which presenter would most likely benefit from a custom slide show?

a teacher who teaches four sessions of the same course
3 0
1 year ago
Read 2 more answers
Does the submission include the file "SuperPower.java"? Does the file include a public class called "SuperPower"? Does the class
Oduvanchick [21]

Answer:    

Here is the program fulfilling all the requirements given:

import javax.swing.JOptionPane;      

public class SuperPower{

public static void main(String[] args) {

String power;

power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog(null, power);} }

Explanation:

Does the file include a public class called "SuperPower"

See the statement:

public class SuperPower

Does the class include a public method called "main"? Is the "main" method static?

See the statement:

public static void main(String[] args)

Does the main method have a String assignment statement that uses "JOptionPane.showInputDialog"

See the statement:

power = JOptionPane.showInputDialog("What is your super power?");

Does the main method have a statement that uses "JOptionPane.showMessageDialog"?

See the statement:

JOptionPane.showMessageDialog(null, power);

Does the program convert the String from "JOptionPane.showInputDialog" using the "toUpperCase" method?

See the statement:

power = power.toUpperCase();

Does the submission include a screenshot that shows an Input dialog that asks, "What is your superpower?" Does the submission include a screenshot that shows a Message dialog stating " TO THE RESCUE!", where "" is the input converted to upper case?

See the attached screenshots

If the program does not let you enter an exclamation mark after "to the rescue" then you can alter the code as follows:

import javax.swing.JOptionPane;

public class SuperPower{

public static void main(String[] args) {

String power;

power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog( null, power+"!");} } // here just add an exclamation mark which will add ! after the string stored in  power

5 0
1 year ago
c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
Lilit [14]

The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.

#include<stdio.h>

#include<string.h>

 int* uniqueValue(int input1,int input2[])

 {

   int left, current;

   static int arr[4] = {0};

   int i      = 0;

     for(i=0;i<input1;i++)

      {

         current = input2[i];

         left    = 0;

         if(current > 0)

         left    = arr[(current-1)];

      if(left == 0 && arr[current] == 0)

       {

       arr[current] = input1-current;

       }

       else

   {

       for(int j=(i+1);j<input1;j++)

       {

           if(arr[j] == 0)

           {

               left = arr[(j-1)];

               arr[j] = left - 1;

           }

       }

   }

}

return arr;

}

4 0
2 years ago
Write a function called sum_scores. It should take four arguments, where each argument is the team's score for that quarter. It
saw5 [17]

Answer:

Here is the Python program which has a function sum_scores:

def sum_scores(score1, score2, score3, score4):

   sum = score1 + score2 + score3 + score4

   print(sum)    

sum_scores(14,7,3,0)

Explanation:

  • Method sum_scores takes four arguments, score1, score2, score3, score4.
  • The sum variable adds these four scores and stores the value of their addition.
  • Lastly print statement is used to print the value stored in sum variable which is the value obtained by adding the four scores.
  • Last statement calls the sum_scores method and passes four values to it which are 14,7,3,0
  • The output of the above program is:
  • 24
  • If you want to use return statement instead of print statement you can replace print(sum) with return sum. But in order to display the sum of the scores you can replace sum_scores(14,7,3,0) with print(sum_scores(14,7,3,0))
  • The program along with the output is attached as a screenshot.

5 0
2 years ago
Other questions:
  • Two career fields that lack minority professionals and thus offer many grant opportunities to students are education and _____.
    10·2 answers
  • Kleene star of {1} generates {1, 11, 111, 1111, 11111……}.<br> True<br> False
    12·1 answer
  • Which of the following facts determines how often a nonroot bridge or switch sends an 802.1D STP Hello BPDU message?
    14·1 answer
  • Consider the following relationship involving two entities, students and classes:A student can take many classes. A class can be
    9·1 answer
  • Garrett wants to search through a csv file to find all rows that have either the name John or Bob in them and display them out t
    9·1 answer
  • Danielle, a help desk technician, receives a call from a client. In a panic, he explains that he was using the Internet to resea
    9·1 answer
  • You can deal with gaps in an PHP array in all but one of the following ways. Which one is it? a. Use the array_values() function
    14·1 answer
  • During the name resolution process, which technique is used to avoid congestion when querying a server
    8·1 answer
  • Which best compares and contrasts visual and performing arts? Both careers use communication skills; however, people involved in
    15·2 answers
  • A credit card company receives numerous phone calls throughout the day from customers reporting fraud and billing disputes. Most
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!