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]
2 years 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]2 years 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
Which component is a part of the central processing unit (CPU) of a computer
suter [353]
The arithmetic logic unit (ALU), which performs arithmetic and logical operations.

The control unit (CU), which extracts instructions from memory and decodes and executes them, calling on the ALU when necessary.

6 0
3 years ago
Read 2 more answers
Does technology always follow the science, yes or no and explain the reason your choice
kari74 [83]

Answer:

<h2>NO</h2>

Explanation:

<h2>because Technology does not always follow science but it may actually lead science in some instances. An example is weather forecasting.</h2><h2>Mark me brainliest plz</h2>
7 0
3 years ago
Add me on fornite buddies Lynn_.25
Anna007 [38]

i- why would u ask that

Explanation:

6 0
3 years ago
Read 2 more answers
________ is the information about a file.
GalinKa [24]
Properties is the information about the file
4 0
3 years ago
Folktales have characters with good or bad traits here are some good wise clever kind hardworking I have too add one more good t
s2008m [1.1K]

Answer: good generous bad greedy

Explanation:

5 0
3 years ago
Other questions:
  • Libby wrote an email to her friend. She pressed Shift and the number key 2 together to enter the email address. Which symbol did
    7·2 answers
  • An airline company would like to easily locate lost luggage. What technology would make it easier for them to locate the luggage
    6·2 answers
  • Which computer network component allows data transfers from one computer to another through a telephone line?
    11·2 answers
  • The ____ button resets slide placeholders to their default position, size, and text formatting.
    11·1 answer
  • Windows 1.0 was not considered to be a "true" operating system but rather an operating environment because _____.
    13·1 answer
  • Upon looking out at the
    8·2 answers
  • .____________ is a way to identify and differentiate goods andservices through use of a name or distinctive design element.
    10·1 answer
  • Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program s
    15·2 answers
  • If you wish to maintain a consistent style to all the documents you create, it would be helpful to use a _​
    5·1 answer
  • Google Glass, glasses that allow you to take pictures and search online by speaking commands, are introduced at a technology tra
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!