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]
3 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]3 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
In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said. slightly add someth
SashulF [63]

Answer:

gives back less (or distorts) than what the client has said.

Explanation:

Emotional intelligence can be defined as the cognitive ability of an individual or person to be able to recognize his or her emotions, have an understanding of the message being conveyed and knowing how these emotions affect the people around him or her.

Basically, there are five (5) main characteristics or features of emotional intelligence and these are;

I. Motivation.

II. Self-awareness.

III. Social skills.

IV. Self-regulation.

V. Empathy.

Empathy simply means putting yourself in a person's position, depicting how you will feel if you were in his or her situation. Also, empathy depicts getting the perspective of a thing through another person's lens, eyes or ears.

There are three (3) main types of empathy and these includes;

I. Basic (interchangeable empathy).

II. Additive empathy.

III. Subtractive empathy.

In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said.

This ultimately implies that, subtractive empathy requires the counselor using an inappropriate listening or influencing skills.

5 0
2 years ago
Use search engines and websites to research the following WAN technologies to complete the table below:
Yuki888 [10]

Answer:

Explanation:

I am attaching the table as an image with updated table containing required information for the following WAN technologies.

T1/DS1 => Digital Signal 1 (T-Carrier 1),

T3/DS3 => Digital Signal 3 (T-Carrier 3),

OC3 (SONET) => Optical Carrier 3 (Synchronous Optical Networking),

Frame Relay,

ATM => Asynchronous Transfer Mode,

MPLS => Multi-protocol Label Switching,

EPL => Ethernet Private Line.

Although you have mentioned most of the information yourself, there were some wrong data in it.  So I have updated them with correct information in the attached table.

4 0
3 years ago
Read 2 more answers
private members of a class are accessible only from _____________ of the same class or from their friends
maxonik [38]

Answer: Within other member

Explanation:

 The private data member is also known as private function in the computer programming language. The private keyword is basically used to specify the access level and also provide the variable and the methods control to the programmers in the class.

In the class, the variables and the method are directly access by the other methods with the same class but not directly access by the derived class. Therefore, the private members of the class are easily access from the other member of the similar class and also from friends.    

8 0
3 years ago
How do you measure the capacity of speed and memory of computer system<br>Explain.​
jeka94
Im sorry i just need points
3 0
3 years ago
/*this function represents
sergey [27]

anything

Explanation:

I know what to say this time

7 0
3 years ago
Read 2 more answers
Other questions:
  • A user reports that she can't access the new server used in the accounting department. you check the problem and find out that h
    9·1 answer
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • An inventory clerk, using a computer terminal, views the following on screen: part number, part description, quantity on hand, q
    8·1 answer
  • 16. Which of the following wire gage sizes is the thickest? A. 14 B. 8 C. 0 D. -33
    14·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • 2:3:5<br>_ _ _<br>3 2 8<br><br><br><br>find ratio​
    5·1 answer
  • An entrepreneur identifies and fills the gap between what the society needs and what is available is called​
    5·1 answer
  • In disc brakes, pads are forced against the of a brake disc​
    14·1 answer
  • Define a function Output Value() that takes two integer parameters and outputs the sum of all negative integers starting with th
    6·1 answer
  • How many different four-letter combinations for a locker password can you make with the lowercase and uppercase forms of the fir
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!