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
hodyreva [135]
4 years ago
13

Consider sorting n numbers stored in array A by first finding the smallest element of A and exchanging it with the element in A[

1]. Then find the second smallest element of A, and exchange it with A[2]. Continue in this manner for the first n − 1 elements of A. Write pseudocode for this algorithm, which is known as selection sort. What loop invariant does this algorithm maintain? Why does it need to run for only the first n − 1 elements, rather than for all n elements? Give the best–case and worst–case running times of selection sort in Θ–notation.
Computers and Technology
1 answer:
krek1111 [17]4 years ago
7 0

Answer:

1. create the first array A

2. create the second array A1, the same length as array A.

3. create a loop to iterate over both arrays for a number of times specific to the length of the arrays, with a condition to get and pop only the minimum value of which arrays for every loop.

4. save both items to "a" for minimum value A and "b" for minimum value A1.

5. call a function to push the "a" variable value to A1 and "b" variable value to the array A.

Explanation:

This code would interchange the values of both arrays, the best-case scenario for the code is O( n ) where n is the number of items in both arrays and worst is the best-case multiplied by the number of time to compare all the items with the minimum value.

You might be interested in
Arrange the following units of storage in descending<br> order. B, TB,KB, GB,MB
adell [148]

Answer:

TB,GB,MB,KB,B

Explanation:

7 0
3 years ago
An attacker obtains a connection to your LAN and then uses SETH to perform a MiTM attack between your system and the company RDP
maxonik [38]

The type of attack which has occurred in this scenario is known as credential harvesting.

<h3>What is credential harvesting?</h3>

Credential harvesting is also known as account harvesting and it can be defined as a type of attack that involves the use of the following techniques to illegally obtain large numbers of user credentials (username or password):

  • MITM attacks
  • DNS poisoning
  • Phishing

In conclusion, the type of attack which was used in this scenario is known as credential harvesting.

Read more on phishing here: brainly.com/question/23850673

#SPJ1

3 0
2 years ago
When replacing a system board in a laptop, which feature is a must?
Sphinxa [80]
I would use a dual core Becuase a quad can be too space consuming and it can overheat the computers software
6 0
3 years ago
A security administrator has replaced the firewall and notices a number of dropped connections. After looking at the data the se
Nata [24]

Answer:

The correct answer is Option(A) i.e., An SQL injection attack is being

attempted.

Explanation:

In this given question some information is missing and is not the complete question. The missing is given as :

SELECT * FROM and ‘1’ = ‘1’

Which of the following can the security administrator determine from this?

A. The SQL injection attacked is being attempted.

B. An Legitimated connections is being dropped.

C. The network scan are being done by the system.

D. An attack of XSS is being attempted.

Now, coming to the answer "The security administration sees that an SQL injection is attempted while it notices a lot of connection dropped and has replaced with the firewall and will be the possible issue flagged on it, SQL injection is a type of injection that possibly executes harmful or malicious statements and effects any website or web application".

Hence the correct answer is Option A.

5 0
3 years ago
What is meant by reflection?​
lana66690 [7]
It’s something that reflects off something
6 0
3 years ago
Read 2 more answers
Other questions:
  • If you want to conserve ink or toner, you can instruct PowerPoint to print ____ documents.
    10·1 answer
  • The content of a text is its
    8·1 answer
  • What cell phone technology is the most popular in the united states?
    8·2 answers
  • How many lines of text are in your questionnaire document
    5·1 answer
  • WILL GIVE BRAINLIEST!!!!!
    8·1 answer
  • Why is it saying I don’t have a subscription when I paid for it and it shows deducted from my account? I can’t find any phone #
    7·1 answer
  • Why would you choose a mobile device over a laptop? 1-2 sentences.
    11·1 answer
  • Which of these countries has very strict cultural
    8·2 answers
  • Write an Algorithm to print only numbers from 10 to n times using iteration structure
    8·1 answer
  • Iris has completed a graphic design project for a client. what should iris obtain from the client in order to display the work i
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!