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
konstantin123 [22]
3 years ago
15

The sum of the elements of an integer-valued array recursively calculated as follows: The sum of an array of size 0 is 0; Otherw

ise, the sum is the value of the first element added to the sum of the rest of the array. Write an int-valued function named sum that accepts an integer array, and the number of elements in the array and returns the sum of the elements of the array.
Computers and Technology
1 answer:
Ugo [173]3 years ago
8 0
In what language? Most languages have iterator functions like map in JavaScript that will loop through the elements, making this almost a one liner

sum = 0
arr.map( elem => sum += elem )
You might be interested in
. Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push
sp2606 [1]

Answer:

a) The composition of the stack is :- 80,50,20,10.

Where 80 is the top and 10 is the last element.

b) The sequence of the popped items 40,30,70,60,90.

Explanation:

Stack is LIFO type data structure means Last in First Out.The element inserted last will be out of the stack first.The removal and addition is only at the one end that is top.

First 10,20,30,40 will be inserted in the stack. 40 is a the top.Now two pop operations occurs. 40 and 30 will be removed from the stack.

Now 50,60,70 will be inserted in the stack then again two pop operations so 70 and 60 will be removed from the stack.

Now the stack contains 50,20,10.Top = 50.

80 and 90 are added to the stack and 1 pop operation that is 90 will be removed.

Stack is 80,50,20,10 . Top = 80.

Sequence of integers popped=40,30,70,60,90.

4 0
3 years ago
Give the difference betewen recursion and interation in C. Sight what are the advantages and their disadvantages?
mrs_skeptik [129]
I believe you mean iteration. Recursion is when you have a function that calls or uses it's self. it's advantageous because it reduces the amount of code but can fall victim to an endless loop. Iteration is using a while loop or any kind of loop to iterate through a data set normally an array, iteration allows you to do an action for every iterated item but a downside is that it takes a long time to iterate and it is not efficient
8 0
3 years ago
What are examples of some Exotic currencies?
Grace [21]

Answer:

D.

Explanation:

An exotic currency pair is the pair of currencies of a major countries with those markets that are emerging or developing. Such currency pairs are seldomly used as it lacks market depth, added to it, it also contain the possibility of unfair treatment or partial treatment.

<u>Some example of exotic currency pair includes EUR/TRY (Euro and Turkish Lira), AUD/CAD (Australian Dollar and Canadian Dollar), etc.</u>

The example of Exotic currencies from the given options are MXN (Mexican Peso), ZAR (South African Rand), and HKD (Hong Kong Dollar).

Thus the correct option is D.

5 0
3 years ago
How would a designer interpret the word denier?
xxMikexx [17]

Answer:Denier is a unit of measurement that is used to determine the fiber thickness of individual threads or filaments used in the creation of textiles and fabrics. Fabrics with a high denier count tend to be thick, sturdy, and durable. Fabrics with a low denier count tend to be sheer, soft, and silky.

Explanation:

idk if this is right.

7 0
3 years ago
Read 2 more answers
Which of the following best describes a proxy firewall? A. It sends traffic through another host. B. It acts as a gateway for re
12345 [234]
The answer would be B, for your computer is considered a client instead of server.
6 0
3 years ago
Other questions:
  • Anna always has a hard time finding files on her computer because she does not know where she saved them. This also affects her
    12·2 answers
  • Which statement about creating folders is TRUE?
    15·2 answers
  • Which tab provides commands for the most commonly used elements in Word software?
    15·1 answer
  • . Database connectivity software is also known as:
    11·1 answer
  • Lucy wants to develop a web page to display her profile. She wants to just start with a basic page that lists her accomplishment
    13·1 answer
  • You have noticed that one of your DNS servers has possibly been compromised. You believe that a cached DNS entry for your domain
    8·1 answer
  • What is the correct order of headers, from left to right, in a completed frame?
    8·1 answer
  • What type of memory or storage device is prone to losing data if the power goes out?
    5·1 answer
  • Answer the questions about PowerPoint using the drop-down menus,
    15·2 answers
  • A. Mohit has bought a new laptop. The laptop is not working as no software is installed in
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!