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]
3 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]3 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
Write a simple hello world program in python 3
IRINA_888 [86]

Answer:

print("hello world")

Explanation:

a hello world program is simply a program that prints out hello world.

for this you would need to remember to have the same number of brackets on each side and to write print. Also remember when printing to include speech marks.

6 0
3 years ago
Read 2 more answers
CHOOSE THE CORRECT CONTINUOUS TENSES( PRESENT CONTINUOUS,PAST CONTINUOUS AND FUTURE CONTINUOUS) : 1. I saw a snake while I _____
k0ka [10]

Answer:

Explanation:

joe biden>

7 0
2 years ago
// PrintStrings // Traverse the 2D character array "strings" and print each of the contained strings.// See the example outputs
anzhelika [568]

Answer:

C++.

Explanation:

void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]) {

   // Multi dimension array can be traversed through multi-level loops

   for (int i = 0; i < NUM_STRINGS; i++) {

       for (int j = 0; j < STRING_LENGTH; j++) {

           cout<<"<<strings[i][j]<<";

       }

       cout<<endl;

   }

}

Output would be like this, depending on the size of NUM_STRINGS;

"One"

"Two"

"Three"

....

6 0
3 years ago
What does N represent when analyzing algorithms?
Mademuasel [1]

Answer: "N" is considered as the size of the input that is being given in the algorithm.

Explanation: During a problem solving process , a algorithm is used to analyze the problem . Many function and  steps are to be taken care of while analyzing algorithm. Among analyzing step, input is also given which is usually zero more than that . An input has a certain size which is given by the initial "N".  The input size defines the length of the string for the input.

4 0
3 years ago
Why is local hosting not suitable for a public website?
ruslelena [56]

Answer:

Because its only available to the host

Explanation:

8 0
2 years ago
Other questions:
  • Knowing the meaning of the acronym WYSIWYG can be most helpful to you when you
    14·1 answer
  • The _____ helps the project team to identify the main functions or features of the system and the different users or external sy
    15·1 answer
  • Effective display designs must provide all the necessary data in the proper sequence to carry out the task. Identify a recent pe
    12·1 answer
  • _______ allows you to add formatting such as shapes and colors to text.
    14·1 answer
  • Write a program that accepts two integers from the user and perform one of the four arithmetic operations based on user’s choice
    11·1 answer
  • What is a type of transition used for music in Earsketch
    11·1 answer
  • Cloud-based services can open doors to leveraging Artificial Intelligence (AI) without dramatically increasing risk. Which clien
    9·1 answer
  • GUYS THERE IS A HACKER IN BRAINLY PLEASE DONT PRESS ON THE WEBSITE THEY WILL HACK YOU.
    9·2 answers
  • A network device that is used to connect multiple devices together without segmenting a network is a __________.
    10·1 answer
  • Why should we apply print preview before printing the document.​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!