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
Rashid [163]
3 years ago
11

Give a recursive algorithm MATRIX-CHAIN-MULTIPLY (A, s, i, j) that actually performs the optimal matrix-chain multiplication, gi

ven the sequence of matrices.
â¨A1,A2,....,Anâ©

the s table computed by MATRIX-CHAIN-ORDER, and the indices i and j. (The initial call would be MATRIX-CHAIN-MULTIPLY (A, s, 1, n).)
Computers and Technology
1 answer:
juin [17]3 years ago
7 0

Answer:

Follows are the code to this question:

MATRIX_CHAIN_MULTIPLY(A,s,i,j)//defining a method MATRIX_CHAIN_MULTIPLY that accepts 4 parameters

if(i == j)//use if block to check i and j value is equal

 return A[i]//return array values

if(j == i+1)//use another if block to check j value is equal to incrementing value of i

 return A[i]*A[j];//return multiplication of array

else//defining else block

 x1 = MATRIX_CHAIN_MULTIPLY(A,s,i,S[i,j])//x1 variable to call above method

 x2 = MATRIX_CHAIN_MULTIPLY(A,s,S[i,j]+1,j)//x2 variable to call above method

 return B1*B2//return multiplication of method holding value

Explanation:

Please find the attached file of the complete question:

In the code, a method "MATRIX_CHAIN_MULTIPLY" is declared, which accepts parameters and uses a conditional statement to check value, which can be defined as follows:

  • In the first, if block, it checks the variable "i and j" value that is equal if it is true it will return an array.
  • In the second if it checks variable j value is equal to incrementing the value of i, if this is true it will return multiplication of array.
  • In the else block two-variable "x1, x2" is used that calls the above method and returns its multiplicating value.

You might be interested in
Which of the following would be better communicated with an image than with text?
slega [8]

Answer:

A decor to a wedding

Explanation:

its bc who would want to know how its described when u could look of how it looks u might be speechless

8 0
3 years ago
Which of the following should you consider when choosing a file format?
Mkey [24]

Answer:

C, the need for future access and digital preservation

Explanation:

On e2020

5 0
3 years ago
Read 2 more answers
Which statement describes borders and shading ?
Marina CMI [18]

Answer: Borders are rules you can add to any or all of the four sides of a paragraph. Shading is the color or artistic design you use as background for a paragraph. Borders and shading are formatting tools for enhancing text, paragraphs, table cells or frames.

3 0
3 years ago
Every application program has a _______________ segment
Natali5045456 [20]
"Main" goes in the blank. For example in C++ all of your code goes in the main function.
4 0
3 years ago
Technology changes rapidly. Do you think the development of new technology will slow down at some point? At some point will cons
KiRa [710]

Answer:

1st question=no

2nd question=consumer will never be satisfied.Unless the technology is super strong that nothing can stop it

3rd question=almost everything,first they build technology because they want humans life to be easy.

wish it helps

7 0
3 years ago
Other questions:
  • Why is it more secure to require a user to press ctrl+alt+delete to log on rather than displaying the windows welcome screen?
    15·1 answer
  • Help pleaseeeeeeeeeeeee
    13·2 answers
  • Your marketing director at ABC Marketing Agency would like to set up an email campaign that will use personalization to referenc
    5·1 answer
  • If you have configured your prompt so that it does not show your working directory, you can use the ____ command to verify in wh
    15·1 answer
  • Write a program to generate following series in qbasics 100,81,64,....1​
    13·1 answer
  • Why do we need to make a plan before actions?
    7·1 answer
  • Which best describes how a supporting database will be structured?
    10·1 answer
  • How does links helped a student like you in navigating the different available websites?
    5·1 answer
  • 70 point Brainlist to best answer
    15·1 answer
  • What is the greatest number of bits you could borrow from the host portion of a class B subnet mask and still have at least 130
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!