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
defon
2 years ago
10

Freeeeeeee brainliest!!!

Computers and Technology
1 answer:
kondaur [170]2 years ago
7 0

Answer:

Oh Thanks :)

Explanation:

You might be interested in
Recursively computing the sum of the first n positive odd integers, cont. About (a) Use induction to prove that your algorithm t
julia-pushkina [17]

The recursive function would work like this: the n-th odd number is 2n-1. With each iteration, we return the sum of 2n-1 and the sum of the first n-1 odd numbers. The break case is when we have the sum of the first odd number, which is 1, and we return 1.

int recursiveOddSum(int n) {

 if(2n-1==1) return 1;

 return (2n-1) + recursiveOddSum(n-1);

}

To prove the correctness of this algorithm by induction, we start from the base case as usual:

f(1)=1

by definition of the break case, and 1 is indeed the sum of the first odd number (it is a degenerate sum of only one term).

Now we can assume that f(n-1) returns indeed the sum of the first n-1 odd numbers, and we have to proof that f(n) returns the sum of the first n odd numbers. By the recursive logic, we have

f(n)=f(n-1)+2n-1

and by induction, f(n-1) is the sum of the first n-1 odd numbers, and 2n-1 is the n-th odd number. So, f(n) is the sum of the first n odd numbers, as required:

f(n)=\underbrace{\underbrace{f(n-1)}_{\text{sum of the first n-1 odds}}+\underbrace{2n-1}_{\text{n-th odd}}}_{\text{sum of the first n odds.}}

6 0
3 years ago
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
nevsk [136]
Here is a Python program:

tmp = input().split(' ')
c = tmp[0]; s = tmp[1]
ans=0
for i in range(len(s)):
if s[i] == c: ans+=1

# the ans variable stores the number of occurrences
print(ans)
5 0
2 years ago
You are writing a device driver for an audio device connected to your computer. Your code needs to determine if the device is bu
Zepler [3.9K]

Answer: hello the options related to your question is missing attached below is the complete question and options

answer : Read the status register ( A )

Explanation:

To determine if the device is busy or ready to accept a new command the line of action is to write a code that will Read the status register. A status register   is a hardware register which contains the information about the processor of the device ( i.e. whether the processor is busy or ready )

5 0
2 years ago
What is your favorite anime?
ira [324]

Answer:

Fullmetal Alchemist: Brotherhood (160,975)

Explanation:

Fullmetal Alchemist: Brotherhood (160,975)

6 0
2 years ago
What is an computer engineering?? ​
Nana76 [90]

Answer:

Computer engineering is a branch of engineering that integrates several fields of computer science and electronic engineering required to develop computer hardware and software.

Explanation:

5 0
2 years ago
Other questions:
  • How many valence electrons are present in the atom of the atomic number of 12?
    10·1 answer
  • ________ results when leisure time and available tools allow us to engage in creative acts.
    14·1 answer
  • What is the importance of Mathematical Modeling in the field of bioinformatics.
    8·1 answer
  • In which step of writing a program does a programmer first use a<br> compiler?<br> documentin
    6·1 answer
  • Out of a list of the values 8, 3, 30, 5, 15, and 6, what result would the MIN function return?
    9·2 answers
  • Based on the code you created in this Unit, propose a way to re-use most of the code (with different information in the variable
    14·1 answer
  • Miriam Is a network administrator. A few employees want to access sensitive Information stored on a backup device. She wants to
    13·1 answer
  • Ano ang dalawang paraan sa paggawa ng abono?​
    6·1 answer
  • Write a program using for loop to find the cube of numbers from 50-100 <br> FASTT
    11·1 answer
  • What does this comparison block indicate?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!