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
nadya68 [22]
3 years ago
12

Write a function solution that given an array a of n integers (between -100 and 100), returns the sign (-1,0,1) of product of al

l the numbers in the array multiplied
Computers and Technology
1 answer:
JulijaS [17]3 years ago
4 0

left[0]=a[0];

for(int i=1;i<=n-1;i++)

   left[i]=(left[i-1]*a[i])%M;

right[n-1]=a[n-1];

for(int i=n-2;i>=0;i--)

   right[i]=(right[i-1]*a[i])%M;

for query q

   if(q==0)

       return right[1]%M;

   if(q==n-1)

       return left[n-2]%M;

   return (left[q-1]*right[q+1])%M;

You might be interested in
Write a class called SimpleSquare that has the following properties: - public int field called num - private int field called sq
mezya [45]

Answer:

public class SimpleSquare{

   public int num;

   private int square;

   

   public SimpleSquare(int number){

       num = number;

       square = number * number;

   }

   

   public int getSquare(){

       return square;

   }    

}

Explanation:

*The code is in Java.

Create a class called SimpleSquare

Declare two fields, num and square

Create a constructor that takes an integer number as a parameter, sets the num and sets the square as number * number.

Since the square is a private field, I also added the getSquare() method which returns the value of the square.

6 0
3 years ago
Which organization developed a network called CSNET to provide a network free to all American research and educational instituti
Citrus2011 [14]
<span>The National Science Foundation (NSF) is the organization which </span><span>developed a network called CSNET to provide a network free to all American research and educational institutions. It is an agency in the government of the United States that is responsible for research and development in the field of science and engineering. </span>
7 0
3 years ago
Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This
lutik1710 [3]
I’m confused what are you asking
7 0
3 years ago
And the Founder/Developer of PHP is ____________.
Bingel [31]

Answer:

b. RasmusLerdorf

Explanation:

RasmusLerdorf is the founder/developer of PHP. He created it in 1994. He is a   Danish national who migrated to Canada in 1980.He implemented PHP to support his personal home page and the language continued to get extended  by adding more and more functionality. The original language parser was redeveloped for version 3 in 1997. The latest release of PHP is 7.x made available since December 2015.

7 0
3 years ago
____ means saving data in computer memory.
Dima020 [189]

Answer: Storage

Explanation:

Storage means means saving data in computer memory. Memory refers to the location which is meant for short-term data, while storage is the part of the computer system that allows an individual to store and also access data on long-term basis.

It should be noted that typically, storage usually comes in form of a hard drive or a solid-state drive.

3 0
3 years ago
Other questions:
  • A contracting company recently completed it's period of performance on a government contract and would like to destroy all infor
    13·1 answer
  • A company currently uses Microsoft Active Directory as its identity provider. The company recently purchased Oracle Cloud Infras
    13·1 answer
  • Multiple arrays. Jump to level 1 For any element in keysList with a value greater than 40, print the corresponding value in item
    7·2 answers
  • One of your start-ups uses error-correcting codes, which can recover the original message as long as at least 1000 packets are r
    8·1 answer
  • The image below shows an encoding for a black and white pixel image. The first two
    13·1 answer
  • A ____________ is a collection of commands given a name.
    11·1 answer
  • The User Datagram Protocol (UDP) is called the connectionless protocol because: It does not attempt to fix bad packets but resen
    8·1 answer
  • When is it appropriate to utilize the nat network connection type?
    8·1 answer
  • The original programs awaiting tanslation is called​
    11·1 answer
  • Describe the data update difference between operational and analytical data.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!