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
aalyn [17]
3 years ago
14

At the county fair, prizes are awat rded to the five heaviest cows. More than 2000 cows are entered, and their records are store

d in an array. Which of the following algorithms provides the most effecient way of finding the records of the five heaviest cows?
a. Selection Sort
b. Selection Sort terminated after the first five iterations
c. Insertion Sort
d. Insertion Sort terminated after the first five iterations
e. Mergesort
Computers and Technology
1 answer:
Sergeu [11.5K]3 years ago
6 0

Answer:

B

Explanation:

selection sort for each pass sorts one element in right place . so we can stop it after 5 passes as we need only 5 heaviest cows info.

Answer is B

You might be interested in
Write Scheme functions to do the following. You are only allowed to use the functions introduced in our lecture notes and the he
klio [65]

Answer:

Check the explanation

Explanation:

solution a:

def Rotate(string) :

n = len(string)

temp = string + string

for i in range(n) :

for j in range(n) :

print(temp[i + j], end = "")

print()

string = ("abcde")

Rotate(string)

solution b:

nums = [3,9,5,8,2,4,7]

res = list(filter(lambda n : n < 5, nums))

print(res)

7 0
3 years ago
How did imperialism lead to WWI? A The debate of the morality of imperialism created tensions around Europe b Native people were
Sati [7]

Answer:

d. European nations competed and made alliances to control colonies.

Explanation:

The world War I was a period of battle between various countries from 1914 to 1918. It started formally on the 28th of July, 1914 and ended on the 11th of November, 1918.

Imperialism can be defined as a policy, ideology, or advocacy that sought to extend a country's power, dominion, authority and influence over another country through diplomacy, use of military force or colonization (direct territorial acquisition).

This ultimately implies that, imperialism is an advocacy or policy that is typically used to impose or extend a country's power, dominion, authority and influence. It simply means to seek colonies of other nations or countries.

Hence, imperialism led to WW1 because European nations competed and made alliances to control colonies.

In conclusion, there was an eagerness on the part of European Nations to gain colonial territories that were owned by other rival nations.

8 0
3 years ago
You have a Windows 2016 Server with DFS. During normal operation, you recently experience an Event 4208. What should you do firs
Anna007 [38]

Answer: Increase your staging folder quota by 20%

Explanation:

The Distributed File System (DFS) allows the grouping of shares on multiple servers. Also, it allows the linking of shares into a single hierarchical namespace.

Since there's a Windows 2016 Server with DFS and during normal operation, an Event 4208 was experienced, the best thing to do in order to address the issue is to increase the staging folder quota by 20%.

6 0
3 years ago
Write a method called findNames that meets the following specs: It takes two arguments: a list of strings, allNames, and a strin
Anna11 [10]

Answer:

public class Solution {

   public static void main(String args[]) {

       String[] allNames = new String[]{"Bob Smith", "Elroy Jetson", "Christina Johnson", "Rachael Baker", "cHRis", "Chris Conly"};

       String searchString = "cHRis";

       

       findNames(allNames, searchString);

   }

   

   public static void findNames(String[] listOfName, String nameToFind){

       ArrayList<String> resultName = new ArrayList<String>();

       

       for(String name : listOfName){

           if (name.toLowerCase().contains(nameToFind.toLowerCase())){

               resultName.add(name);

           }

       }

       

       for(String result : resultName){

           System.out.println(result);

       }

   }

}

Explanation:

The class was created called Solution. The second line define the main function. Inside the main function; we initialized and assign an array called allNames to hold the list of all name. Then a String called searchString was also defined. The searchString is the string to search for in each element of allNames array. The two variables (allNames and searchString) are passed as argument to the findNames method when it is called.

The method findNames is defined and it accept two parameters, an array containing list of names and the name to search for.

Inside the findNames method, we initialized and assigned an ArrayList called resultName. The resultName variable is to hold list of element found that contain the searchString.

The first for-loop goes through the elements in the allNames array and compare it with the searchString. If any element is found containing the searchString; it is added to the resultName variable.

The second for-loop goes through the elements of the resultName array and output it. The output is empty if no element was found added to the resultName variable.

During comparison, the both string were converted to lower case before the comparison because same lowercase character does not equal same uppercase character. For instance 'A' is not same as 'a'.

8 0
3 years ago
At least four things you believe are important in order to maintain a professional image.
Olegator [25]

Answer:

Yes

Explanation:

6 0
3 years ago
Other questions:
  • Marie can now edit her photos, send them in emails, print them on a printer, and use them as wallpaper on her computer. This is
    9·2 answers
  • Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?
    5·1 answer
  • When making college visits, you may be able to....
    9·2 answers
  • Can you share a google Docx. with a person who has an Icloud Email?
    11·1 answer
  • What is an LMS and how is it used?
    8·1 answer
  • Given a constant named size with a value of 5, which statement can you use to define and initialize an array of doubles named ga
    12·1 answer
  • A_______ to show the working of an object before it is built or made. A. Prototype b. Test c. Evaluation d. Plan
    10·1 answer
  • The development methodology where each part of a project is done in order after each other is called:
    15·1 answer
  • In cell a10 enter a formula using or to display true if net profit before tax in 2019 (cell b5) are greater than 750000(seven hu
    15·1 answer
  • Q 1: How computer produces result?<br> Q 2: Write function of power supply in system unit?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!