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
Should organizations fear websites where consumers post negative messages about products or services? What actions can companies
pickupchik [31]

Answer:

This is something that actually helps organizations to improve their work and subsidiaries by people's real time assessement.

Explanation:

When consumers post negative messages, whether they are true or not, organizations have the opportunity to have an online conversation with consumers and provide help in real time communication. This improves communication within a company and with other subsidiaries by evaluating honest and threatening comments related to e-commerce real life development. There are a lot of people who do not use products according to the comments available on their marketing webpages, such as myself. These are all important for everyone to assess if it is worth to buy a product or not, and to keep up an online community in which people help each other by suggestions and recommendations, and organizations can take a lot of advantages from that, such as increasing their number of consumers.

5 0
2 years ago
An ironworker standing 30 feet in the air is safe wearing a full body harness that is not tied off
Nataly_w [17]

Answer

It is FALSE .

Explanation

A full body harness is a  type of safety 'attire' specifically put on for the purposes of protection. Safety harness are necessarily for fall protection. It also provides the user or the worker comfortability and confidence while working on those high risky places. It is advisable that when a worker is exposed to a fall hazard which about six feet and above high to wear a harness that is tied off.

8 0
3 years ago
Read 2 more answers
When Clara accesses the programs and documents on her computer by way of icons, she is said to be employing
xxMikexx [17]
<span>D - graphical user interface</span>
5 0
3 years ago
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
oksano4ka [1.4K]

Answer:

The program in Python is as follows:

def get_user_values():

   user_values = []

   n = int(input())

   for i in range(n+1):

       inp = int(input())

       user_values.append(inp)

   output_ints_less_than_or_equal_to_threshold(user_values,user_values[n])

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

   for i in user_values:

       if i <= upper_threshold:

           print(i,end=" ")

           

get_user_values()

Explanation:

This defins the get_user_values() method; it receives no parameter

def get_user_values():

This initializes user_values list

   user_values = []

This gets the number of inputs

   n = int(input())

This loop is repeated n+1 times to get all inputs and the upper threshold

<em>    for i in range(n+1):</em>

<em>        inp = int(input())</em>

<em>        user_values.append(inp)</em>

This passes the list and the upper threshold to the output..... list  output_ints_less_than_or_equal_to_threshold(user_values,user_values[n])

This defines the output.... list

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

This iterates through the list

   for i in user_values:

If current element is less or equal to the upper threshold, the element is printed

<em>        if i <= upper_threshold:</em>

<em>            print(i,end=" ")</em>

The main method begins here where the get_user_values() method is called

get_user_values()

7 0
2 years ago
Which word most strongly appeals to pathos?
const2013 [10]

Answer:

I think it would be unfulfilled

6 0
3 years ago
Other questions:
  • .2. What approach to deviance do you find most persuasive: that
    9·1 answer
  • What is the most efficient way to include a space after each paragraph?
    13·2 answers
  • What role do you think mobile devices have played in shaping the world?
    13·1 answer
  • What does subscribing to a website’s RSS feed provide to a subscriber?
    10·1 answer
  • What feature new to Windows Server 2012 provides the ability to find identical sets of data on a SAN based storage array and red
    14·1 answer
  • Que son los sistemas de control con retroalimentacion
    10·1 answer
  • What is the internet ?
    11·2 answers
  • Consider a binary-search method in an array that reports whether an object is in the array. The documentation indicates that the
    11·1 answer
  • A student registers for a course in a university. Courses may have limited enrollment i.e a student must
    5·1 answer
  • Please tell fast plzzzzzzzz​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!