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
vfiekz [6]
3 years ago
7

Write the recurrence relation for the following program fragment, assuming somethingElse(n) requires constant amount of work. Yo

u don’t have to solve this recurrence relation.int something (int n) { if (n < 50) { System.out.println("!"); return n+10;else { return something(n-1) + somethingElse(n);
Computers and Technology
1 answer:
IgorC [24]3 years ago
8 0

Answer:

 = T(n) = 1  for n < 50

  = T(n) = T(n-1) + 1 for  n >= 50

Explanation:

The Given program fragment is :

int something (int n) {

if (n < 50) {

       System.out.println("!");

return n+10;

else {

    return something(n-1) + somethingElse(n);

  }

}

The recurrence relation for the program fragment above can be expressed as :

      = T(n) = 1  for n < 50

also T(n) = T(n-1) + 1 for  n >= 50

You might be interested in
Which of the following is a quick way to restore the arrow pointer after you have used it for drawing?
Oxana [17]
A quick way to restore the arrow pointer after you have used it for drawing is to press the esc key.  The esc key is <span>used for any of the different </span>functions<span>, as to interrupt or cancel the current process or running program, or to close a pop-up window.</span>
7 0
3 years ago
Whats the difference between copying a file to my desktop and creating a shortcut?
hram777 [196]
When you copy a file to the desktop you are putting the actual file on the desktop whereas when you put a short cut on the desktop you are just placing a reference to where the file is actually located.
3 0
3 years ago
Jenny is working on a laptop computer and has noticed that the computer is not running very fast. She looks and realizes that th
Ulleksa [173]

Answer:

1. She Should Order C. SO-DIMM DDR 3

2. a. Show him how to find System Summary data in the System Information utility in Windows and then do online research.

Explanation:

8 0
3 years ago
Devices on a network are identified by what?
Ne4ueva [31]

Answer:

devices on a network are identified by their IP and MAC addresses

5 0
2 years ago
If an M:N relationship is mandatory on both sides, and if both relations resulting from the entities involved in the relationshi
vivado [14]

Answer:

0

Explanation:

In the problem above, the relationship that exists between M and N is discovered to be on each side of the system. Furthermore, it was stated that the outcome of the relationship also has approximately 3 records. This shows that there is no record for the bridge that is formed as a result of the relationship.

4 0
4 years ago
Other questions:
  • Which of these printers would be the most suitable for printing a large number of high quality black and white printouts?
    15·1 answer
  • A company that hires only American Indians is practicing
    5·2 answers
  • Write a Java program that can compute the interest on the next monthly mortgage payment. The program reads the balance and the a
    12·1 answer
  • What are the features of the Outline view in Word? Select three options.
    14·2 answers
  • In a nested repetition structure, one loop, referred to as the ____ loop, is placed entirely within another loop, called the ___
    5·1 answer
  • This diagram shows a number of computing devices connected to the Internet with each line representing a direct connection.
    11·1 answer
  • Which is a primary document?<br> a. letter<br> b. dictionary<br> c. textbook<br> d. website
    11·1 answer
  • Which of the following is not a selection tool in Adobe photoshop
    15·2 answers
  • What are business rules​
    14·1 answer
  • Look out for users with this photo.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!