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
Viktor [21]
3 years ago
5

Consider the following correct implementation of the selection sort algorithm.

Computers and Technology
1 answer:
rewona [7]3 years ago
4 0

Answer:

c. 3

Explanation:

The line of code on line 19

elements[minIndex] = temp;

will run a total of 3 times in with this call to the selectionSort method. The first time it will turn the 10 in position 2 into a 30. The second time it will turn the 20 in position 4 into a 40. Finally, it will turn the newly positioned 40 in position 4 into a 50. Therefore, completely sorting the array's elements.

You might be interested in
Write a Python program that will take as input 5 integer values and will output the average of the odd values and the average of
8_murik_8 [283]

Code:

Here is the code. Also screenshot of the code and text file containing the code have been attached here.

This code has been written in Python 3.0

# getting input

lst = [ ]  

n = 5  

for i in range(0, n):  

   ele = int(input())  

   lst.append(ele)

print(lst)

# getting odd numbers and even numbers from list and compute average

odd_sum = 0

even_sum = 0

odd = 0

even = 0

for i in range(0, n):  

   if lst[i] % 2 == 0:

       even_sum = even_sum + lst[i]

       even = even + 1

   elif lst[i] % 2 > 0:

       odd_sum = odd_sum + lst[i]

       odd = odd + 1

       

odd_avg = odd_sum/odd

even_avg = even_sum/even

print("there were",odd,"odd numbers in input")

print("there were",even,"odd numbers in input")

print("average of odd numbers in the list",odd_avg)

print("average of even numbers in the list",even_avg)

6 0
3 years ago
Identify the calculation performed by the following code.
lbvjy [14]

Answer:

48

Explanation:

The function returns length * width

In the function call, the values are legnth: 8 and width: 6 this means the function is returns 8 * 6 wich is 48.

8 0
2 years ago
When a computer restarts without a hardware power-down-power-up cycle, it is doing a _______________?
tamaranim1 [39]
When a computer restarts without a hardware power-down-power-up cycle, it is doing an update.
4 0
3 years ago
Pls help me thx would really help me
Assoli18 [71]

Answer:

rooster don't lay eggs tho

4 0
3 years ago
Read 2 more answers
Which of the following best describes how computing devices represent information? A. A computer will either represent informati
lana66690 [7]

Answer:

The Answer is B

Explanation:

The reason the answer is B is because "bytes" are the correct form of storing memory in 0's and 1's.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which technological innovations along history allowed the appearance of the computer
    9·2 answers
  • You are angry at a friend who forgot to meet you for lunch, and you decide to write an e-mail about how it made you feel. What s
    11·2 answers
  • Can you give me a long list of kid's cartoons
    8·2 answers
  • What is wrong with the following code? How should it be fixed?
    12·1 answer
  • Which type of market are you in if your firm, along with three other firms, controls 95% of the total music industry?
    13·1 answer
  • In which of the following careers are you most likely to do an apprenticeship?
    14·2 answers
  • You're a short-order cook in a pancake restaurant, so you need to cook pancakes as fast as possible. You have one pan that can f
    14·1 answer
  • What operation can be performed using the total feature ​
    13·1 answer
  • state how to transfee information from website to el processing document in computers and technology.​
    12·1 answer
  • Which of the following commands can be used to display socket information out to the terminal screen
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!