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
geniusboy [140]
3 years ago
8

Give a recursive algorithm for finding the sum of the first n odd positive integers.

Computers and Technology
1 answer:
Andrei [34K]3 years ago
3 0
I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

function sumOdd(n)
    if n==1 then
        return 1
    end if
    return (sumOdd(n-1))+(n*2-1)
end function
You might be interested in
Difference between implicit and explicit type casting
Lana71 [14]

Answer:

Implicit type casting means the type casting done by the compiler during compilation of program whereas Explicit type casting means the programmer explicitly type casts the variables. This is the difference implicit and explicit type casting.

Explanation:

Type casting means the conversion of one data type into another data type. There are two types of type casting. They are Implicit type casting and Explicit type casting.

<u>Implicit type casting:</u> The type casting which is done by the compiler during the compilation of a program. This occurs when we assigning smaller data type to larger data type and also both the data type are compatible. Below example clears the above concepts.

Ex: int \, i = 10;

long \, l = i;

In the above example " i "  is " int " data type whereas  " l " is long data type but as we assigned the value of " i " to " l ". Here " int " and " long " are compatible data types and we assigned smaller data type ( int - i ) to larger data type  ( long - l ) implicit type casting occurs.

<u>Explicit type casting:</u> The type casting which is done by the programmer explicitly to convert one data type into other data type. If we want to assign a value of larger data type to smaller data type explicit type casting is required. Below example clears the above concepts.

Ex: double \, d = 10.4;

long\, l = (long) d;

In the above example " d " is " double " data type whereas " l " is " long " data type. Here we are explicitly type casting to change larger data value ( double - d ) to smaller data value ( long - l ).  

7 0
3 years ago
Read 2 more answers
Jim wants to develop an app for a specific purpose that would run even when his computer is not connected to the Internet. What
Vadim26 [7]

Answer:

NOT mobile app. NOT Cloud-based app.

Explanation:

4 0
3 years ago
Bob works at a cafe where he earns $11 an hr. which of the following graphs describes the amount of money that bob earns after x
Sergio039 [100]
Where are the graphs?
8 0
3 years ago
Read 2 more answers
Suppose a worker needs to process 100 items. the time to process each item is exponentially distributed with a mean of 2 minutes
stiks02 [169]
Suppose a worker nneeds to process100 items
7 0
3 years ago
A communications medium that carries a large amount of data at a fast speed is called
babymother [125]
Either Firewire, or an ethernet cable.
7 0
3 years ago
Other questions:
  • You can use Facebook's live feed tool to broadcast content as you post it
    8·2 answers
  • Which network topology requires terminators at the ends of the backbone cable?
    6·1 answer
  • Which of the following are incorrect safety precautions for equipment operators? A. Drive equipment or vehicles on grades or roa
    7·2 answers
  • How many hosts are in each subnet?
    15·1 answer
  • A large IPv4 datagram is fragmented into 4 fragments at router 1 to pass over a network with an MTU of 1500 bytes. Assume each f
    15·1 answer
  • An application ________ is anyone who writes a computer application for one or more platforms.
    5·1 answer
  • A ________ is a self-contained program that spreads through a computer network by exploiting security holes in the computers con
    9·1 answer
  • Which is NOT a benefit of using visual aids?
    9·2 answers
  • Help plz
    10·1 answer
  • Who is tim berners-lee
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!