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
Lostsunrise [7]
1 year ago
12

for a given array of integers perform operations on the array return the resulting array after all operations have been applied

in the order given
Computers and Technology
1 answer:
steposvetlana [31]1 year ago
3 0

Using the knowledge in computational language in python it is possible to write a code that given array of integers perform operations on the array return the resulting array after all operations.

<h3>Writting the code:</h3>

#This is the function ReverseArrayQueries(),it takes a 1d array arr and a 2d array operations as parameters

def ReverseArrayQueries(arr,operations):

   ##Start a for loop,to check each 1d array of operations array

   for i in range(0,len(operations)):

       ##Store first element of current array in p variable

       p=operations[i][0]

       ##Store second element in q variable

       q=operations[i][1]

       ##Start a while loop,which continues till q is greater than or equal to p

       while p<=q:

           ##Swap pth and qth element of arr array

           temp=arr[p]

           arr[p]=arr[q]

           arr[q]=temp

           ##Then,increment p by 1 and decrement q by 1

           p+=1

           q-=1

   ##At the end return arr

   return arr

See more about python at brainly.com/question/13437928

#SPJ1

You might be interested in
What is the build in libary function to compare two strings?​
worty [1.4K]

Answer:

strcmp() is a built-in library function and is declared in <string. h> header file. This function takes two strings as arguments and compare these two strings lexicographically.

Explanation:

Hope it helps

3 0
3 years ago
The part of the poppet valve that contacts the valve seat is called the A. face. B. margin. C. head. D. stem.
Phantasy [73]
It should be A face, I think
6 0
3 years ago
Read 2 more answers
3.A ball is thrown into the air with an initial velocity of 15 m/s. a.How long does it take the ball to reach maximum height?b.W
ehidna [41]

Answer:  a) = 1.5 sec.  b= 11.5 m. c=0  d= 1.5 sec.

Explanation:

a) Once thrown into the air , the only influence on the ball is gravity, so, we can conclude that the acceleration acting on the ball is the one due to gravity, i.e., g= 9.8 m/sec².

Applying the definition of acceleration, we can write the following equation:

a= (vf-vo) / t   ⇒ g = vf-vo / t. (1)

Now, when the ball reaches to his maximum height, it stops momentarily, and then starts to fall, so for this height, we can write vf=0.

Replacing  in (1), and solving for t, we get:

t = (0 -vo) / g = -15 m/s/ - 9.8 m/sec² (Taking upward as positive  direction)

a) t= 1.5 sec.

Replacing this value in the kinematic equation for displacement, when vo=15 m/s, we get:

hmax: 15 m/sec . 1.5 sec -1/2. 9.8 m/sec². (1.5 sec) ² (2)

b) hmax= 11.5 m

c) vf= 0 (as explained above)

Finally, in order to know how long the ball takes to return to its initial height, we know that for the falling part of the trajectory, vo=0, so we can write the equation for displacement as follows:

h=-hmax (because it returns to the same starting point)= 1/2 gt²=-11.5 m

Solving for t, we get:

d) t=1.5 sec.

It can be seen that the time used in going up, it is the same for going down, to travel the same distance.

This result is completely general and applies to any free fall problem.

3 0
3 years ago
Alejandra is using a flash drive that a friend gave to her to copy some financial records from the company database so she can c
Misha Larkins [42]

Answer:

maybe threat?

Explanation:

4 0
3 years ago
Will give brainliest!!!!!!!!
dolphi86 [110]

Answer:

d the overall strength of colours

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Think about a time when someone made a biased judgment about you or acted unfairly toward you because of your age, skin color, c
    6·1 answer
  • Format Painter cannot be used to copy only character attributes. True or False
    12·1 answer
  • You are the network administrator for a school system. Your boss informs you that she is thinking of implementing a BYOD program
    15·2 answers
  • What are the names of the four major varnas in the caste system?​
    9·2 answers
  • How do I charge my ACDC Halo bolt?
    11·1 answer
  • The options on the Ribbon will____:
    11·1 answer
  • Select all correct statements below: Group of answer choices A redundant link's switch port will be blocked by STP until needed.
    6·1 answer
  • What is the shortcut key to create a new desktop ​
    11·2 answers
  • In what way, if any, is the impact of a given risk affected by the timing of a project?
    8·1 answer
  • What are some of the most common obstacles in video games?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!