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
strojnjashka [21]
2 years ago
11

2. a. Write pseudocode for a divide-and-conquer algorithm for finding valuesof both the largest and smallest elements in an arra

y of n numbers.b. Set up and solve (for n = 2k) a recurrence relation for the number of keycomparisons made by your algorithm.c. How does this algorithm compare with the brute-force algorithm for thisproblem?
Computers and Technology
1 answer:
Lisa [10]2 years ago
6 0

The pseudocode :

Pair MaxiMini(array, sizeof_array)

if sizeof_array = 1

return element as both maximum and minimum

else if sizeof_array = 2

do one comparison to find the maximum and minimum

return that pair

else

# sizeof_array > 2

recursion for maximum and minimum of the left half

recursion for maximum and minimum of the right half

one comparison determines the true max of the two elements

one comparison determines the true min of the two elements

return the pair of maximum and minimum

You might be interested in
What is the difference between the (BIOS) basic.input.output.system and R.O.M
abruzzese [7]
EX: A BIOS is a file used to make an emulator work properly. <span>A ROM is a copy of a game downloadable online.</span>
6 0
3 years ago
A man inside water, the pressure which acts on him is
suter [353]

Answer:

C. Liquid and atmospheric pressure

Explanation:

https://courses.lumenlearning.com/physics/chapter/11-4-variation-of-pressure-with-depth-in-a-fluid/

6 0
2 years ago
Niall is revising a history assignment using a word processor on a Windows computer. He wants to copy a section from an earlier
Zarrin [17]

Answer:Ctrl + V

Explanation:

7 0
1 year ago
When formatting numbers with the Comma Number Format tool, the numbers are formatted with _________.
irina [24]

Answer:

2 decimal places

Explanation:

5 0
2 years ago
What's the purpose of IP
Slav-nsk [51]

Thank you for this question. The answer is that an Ip adress stands fo Internet Protocol which acts like a home adress. Bascily it helps you find a node in a network as the IP adress is made of letters and numbers separated by a full stop. I hope you are happy

4 0
3 years ago
Read 2 more answers
Other questions:
  • Positive and negative impacts of chemical industries
    6·2 answers
  • Which of the following is true of how packets are sent through the Internet?
    11·2 answers
  • What should you do if you forget your root password for MySQL?
    13·1 answer
  • What is the function of a breadcrumb trail in a website ?
    10·2 answers
  • which of these tools stick to the edge of an image, thus making it easy to select the shape of an image
    6·1 answer
  • Who invented slide Rule and when?​
    7·2 answers
  • Write a function called no_you_pick. no_you_pick should have two parameters. The first parameter is a dictionary where the keys
    5·1 answer
  • When testing a game, why might you consider throttling the game’s “frames per second”?
    9·1 answer
  • A timer is set after each frame is sent before waiting an ACK for that frame, how long does the timer take to be expired?
    10·1 answer
  • List seven media features that can be used in media queries.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!