The algorithm S(A, n, i) selects all the j-th smallest elements (with j ≤ i) from an array A of n elements, by using linearselect to select each of the j-th smallest elements (with j ≤ i). Clearly, one could also implement S alternatively as T(A, n, i), which first sort A (on average-case and on worstcase, the sorting takes time O(n log n) using mergesort) and then select the first i elements. Please compare the average-case complexities of the two algorithms; i.e., For the average-case complexities, under what conditions (on the choices for i), S is better than T or vice versa

Answers

Answer 1

Answer:

Follows are the solution to this question:

Explanation:

In the linear selected algorithms scans the given field sequentially but instead calculates the fixed amount by crossing the items throughout the list since they are displayed. Take into consideration the various chosen algorithm:

S(A, n, i) Algorithm:

In array B, copy array A items.

To save results, construct an array C of height.

Start Loop j = 0 to i-1.

Determine array B's lowest value.

In array C, also save the minimum value.

Delete from array B the minimum value.

Back the C array.

Analysis of runtime:

In i iterations, the external loop is used, although i have to compute the number of small lots.

This internal loop should run and calculate the minimum variable, whereby n is the input array length at the most values of n.

Its cumulative runtime is equal to O(in)+C =

O(in). All remaining operations are done at a precise rate.

The combine type technique requires that division concept to

sort the sorted array either in or upwards backward order.

Follow the appropriate method using merge type to

select the shortest items of a certain list.

T (A, n, i) algorithm:

In B array, copy array A elements.

To save the output, build a C array of sizes.

Using merge form in an increasing order to sort all items of the B list.

Start the loop j= 0 to i-1.

Save A[j] value in C[j].

Return array C,

return array C.

Analysis of run time:

The combined function requires O (n log n) to arrange a size n list.

Its number of samples in the process to construct the resulting sequence becomes equal to i since i is the minimum number of elements to also be calculated. All remaining transaction is performed in continuous time.

The time to work is O (n log n) + O i + C = O (n log n). The time needed.

The complexities of the following algorithms are similar:

Scenario 1: S is stronger than to the T-algorithm

Consider the number for smallest elements to also be calculated or even the I value is significantly smaller than the number of array elements.  Let i = 2 and  n = 16.

Its algorithm S requires O(in) time for both the calculation of a result, who in this case is equivalent to (2 16).

If algorithm T finds the initiative of O (n log n), who in this case is equivalent to (16 logs 16) = (16 4).

The S method, therefore, operates better than that of the T algorithm, if another I value exceeds the log n value.

Scenario 2: Algorithm T is much more successful that algorithm S

Evaluate if the number of components which must be calculated is smaller or if the value of I is comparable with that of the items inside the array.

Let the I = 12 quality and n = 16 value. Its S method applies O(in) time, and in this, the situation is just like (12 16).

Hence, the algorithm T performs better than the algorithm S when the value of i is greater than the value of the log n.


Related Questions

Choose the terms that best complete the sentence.

For users to be able to communicate with a large number of other people around the world, their
___needs to be connected to a_____
which has
an almost unlimited geographical distance.

Answers

WiFi needs to be connected to a router

Answer: For users to be able to communicate with a large number of other people around the world, their LAN needs to be connected to a WAN, which has an almost unlimited geographical distance.

Explanation: Correct on Edg 2020/2021.

PLEASE HURRY!!
Look at the image below!

Answers

The missing word is input. The input function asks the user to enter something and in this case, its asking for the user to enter the x-coordinate of the first point.

What is the difference between Information Technology and Communication Technology?​

Answers

Answer:

Explanation:

information tech is technology that teaches you information, and communication tech is tech that lets you talk to family and friends and meet new people.

Answer:

The main difference between information technology and communication technology is that Information technology is a subject that is use of computers to store, retrieve, transmit and manipulate data, or information, often in the context of business or other enterpise whereas a Communication technology is the use of computers to communicate with family and friends.

QUESTION : John travels a lot and he needs to access his documents and services on the go. Which of these technologies allows his to access documents and software while on the move?
!!MUTI ANSWER QUESTION BTW!!
A.cloud computing
B.grid computing
C.mobile computing
D.green computing
E.virtualization

Answers

Answer:

mobile computing

Explanation:

Adding a rock or stone looking characteristic to a background is which element of design?

Answers

Answer:

Explanation:

ejhdkl;xs

'

What type of result does the MATCH function, when used on its own, return?

Answers

Answer:

It returns the lookup value located in a specific location.

Explanation:

PLEASE HURRY!!!
What is the output of this program?

age = 4
if age > 5:
print("more")
else:
print("less")
Output: ______

Answers

Since age is less than 5, the else statement will run. The output will be less

Less is the answer I think

3.2 lesson practice edhesive ​

Answers

Answer:

3.2 Question 1

x = float(input("Enter a number: "))

if (x > 45.6):

   print("Greater than 45.6")

3.2 Question 2

x = float(input("Enter your grade: "))

if (x >= 90):

   print("Great! ")

Explanation:

I hope this works I do not know exactly what you were asking for

ASAP 20 Points please hurry

Answers

Answer:

All you got to do is type System.out printIn("Study English) etc...

Explanation:

Look at the answer to see if it is right.

list any five feature of drwing toolbar

Answers

Line, arrow, rectangle, ellipse, text, vertical text, curve, stars are all possible answers -hope this helped, have a good night!!

Answer:

The tools in this part of the Drawing toolbar are:

Select: selects objects. To select multiple objects click on the top leftmost object and while keeping the mouse button pressed, drag the mouse to the bottom rightmost object of the intended selection. A marching ants rectangle identifying the selection area is displayed. It is also possible to select several objects by pressing the Control button while selecting the individual objects.

Line: draws a straight line.

Arrow: draws a straight line ending with an arrowhead. The arrowhead will be placed where you release the mouse button.

Rectangle: draws a rectangle. Press the Shift button to draw a square.

Ellipse: draws an ellipse. Press the Shift button to draw a circle.

Text: creates a text box with text aligned horizontally.

Vertical text: creates a text box with text aligned vertically. This tool is available only when Asian language support has been enabled in Tools > Options > Language Settings > Languages.

Curve: draws a curve. Click the black triangle for more options, shown below. Note that the title of the submenu when undocked is Lines.

What is the most basic way to create a query?

Answers

Answer- are Navigation queries and keyword search queries.
Hope this helps:)

The IP address and the port are both numbers. Which statement is true?
A computer has many IP addresses and many ports.
A computer has one IP address and many ports.
A computer has one IP address and one port,
Acomputer has many IP addresses and one port.

Answers

Answer:

A computer has one IP address and many ports.

Explanation:

Answer:

A computer has one IP address and many ports.

Explanation:

Select the action that a database does not perform.


Sort and manipulate the data.

Find the average of four numbers.

Update information in more than one place at the same time.

Create data entry forms.

Answers

create data entry forms

Answer:

the answer is B. find the average of four numbers

Explanation:

What issues will the Internet of Things present to Cybersecurity?

Answers

Answer:

The IoT offers new ways for businesses to create value, however the constant connectivity and data sharing also creates new opportunities for information to be compromised. Explore some of the more notable developments in the battle to combat cyber risks.

Explanation:

I hope this helps you. UwU. P.S. Plz mark me Brainlyest

how to unblock a school computer

Answers

Answer: use a vpn

Explanation:

go to Explanation:

apponvps

Write the SQL queries that accomplish the following tasks in the HAFH Realty Company Property Management Database:

Answers

The complete question is:

Write the SQL queries that accomplish the following tasks in the HAFH Realty Company Property Management Database:

a. Display the SMemberID and SMemberName for all staff members.

b. Display the CCID, CCName, and CCIndustry for all corporate clients.

c. Display the BuildingID, BNoOfFloors, and the manager’s MFName and MLName for all buildings.

d. Display the MFName, MLName, MSalary, MBDate, and number of buildings that the manager manages for all managers with a salary less than $55,000.

e. Display the BuildingID and AptNo, for all apartments leased by the corporate client WindyCT.

f. Display the InsID and InsName for all inspectors whose next inspection is scheduled after 1-JAN-2014. Do not display the same information more than once.

g. Display the SMemberID and SMemberName of staff members cleaning apartments rented by corporate clients whose corporate location is Chicago. Do not display the same information more than once.

h. Display the CCName of the client and the CCName of the client who referred it, for every client referred by a client in the music industry.

i. Display the BuildingID, AptNo, and ANoOfBedrooms for all apartments that are not leased.

Also a schema of the HAFH database is attached.

Answer:

Using SQL's SELECT, FROM, WHERE syntax, find below the queries for each question.

a.

SELECT SMemberID , SMemberName  

FROM staffmember

b.

SELECT CCID, CCName, CCIndustry

FROM corpclient

c.

SELECT b.BuildingID, b.BNoOfFloors, m.MFName, m.MLName

FROM building b, manager m

WHERE b.ManagerID = m.ManagerID

d.  

SELECT m.MFName, m.MLName, m.MSalary, m.MBDate, count(*) as buildings

FROM building b, manager m

WHERE m.MSalary<55000

AND b.ManagerID = m.ManagerID

GROUP BY m.ManagerID

e.

SELECT b.BuildingID, a.AptNo

FROM building b, apartment a, corpclient c

WHERE c.CCName = "WindyCT"

AND c.CCID = a.CCID

AND a.BuildingID = b.BuildingID

f.

SELECT DISTINCT i.InsID, i.InsName  

FROM inspector i, inspecting x

WHERE i.InsID = x.InsID

AND x.DateNext > "2014-01-01"

g.

SELECT DISTINCT s.SMemberID, s.SMemberName  

FROM staffmember s, cleaning c, apartment a, corpclient cc

WHERE s.SmemberID = c.SmemberID

AND c.AptNo = a.AptNo

AND a.CCID = cc.CCID

AND cc.CCLocation = "Chicago"

h.

SELECT cc1.CCName, cc2.CCName  

FROM corpclient cc1, corpclient cc2

WHERE cc1.CCIDReferencedBy = cc2.CCID  

AND cc2.CCIndustry = "Music"

i.

SELECT a.BuildingID, a.AptNo, a.ANoOfBedrooms

FROM apartment a

WHERE a.CCID NOT IN (SELECT c.CCID FROM corpclient c)

The following are basic word processing functions that all students should be able to utilize in their work, EXCEPT:

Group of answer choices

A.) Spell check

B.) Convert to PDF

C.) Printing

D.) References

Answers

I would say B or D but preferably B

what are motherboards

Answers

Answer:

Explanation:

Motherboard

A motherboard is the main printed circuit board in general-purpose computers and other expandable systems. It holds and allows communication between many of the crucial electronic components of a system, such as the central processing unit and memory, and provides connectors for other peripherals

Cleary specifying the theme to be used for a site
before building it provides which main advantage:
site navigation
site consistency
O
a clear message
O O O
improved readability

Answers

Answer: site consistency

Answer:

B) Site Consistency

Explanation:

sa kumbensiyon naihalal si andres bonofacio bilang​

Answers

Answer:

the contemporary Supremo (supreme leader) of the Katipunan

What feature did the 32X add to the Sega Genesis?

Answers

Answer:

ngl why would i know this

Explanation:

It allowed the console to run 32-bit cartridges.

2. Which of the following fonts is most legible for a block of text? What font size and color would you choose if you were writing a block of text in a formal business document? (1 point)

Answers

Answer:

Color: Black

Font: Times New Roman

Size: 12

Explanation:

Answer:

Times new roman

front 12

color:black

Explanation:

Times new roman

front 12

color:black

1 // Application contains a starting list of three products for sale2 // The user is prompted for additional items3 // After each new entry, the alphabetically sorted list is displayed4 import java.util.*;5 public class DebugNine36 {7 public static void main(String[] args)8 {9 ArrayListproducts = new ArrayList();10 products.add(shampoo);11 products.add(moisturizer);12 products.add(conditioner);13 Collections.sort(products);14 display(products);15 final String QUIT = "quit";16 String entry;17 Scanner input = new Scanner(System.in);18 System.out.print("\nEnter a product or " + QUIT + " to quit >> ");19 entry = input.nextLine();20 while(entry.equals("quit"))21 {22 products.add(entry);23 Collections.sort(products);24 display()25 System.out.print("\nEnter a product or " + QUIT + " to quit >> ");26 entry = input.nextLine();27 }28 public static void display(ArrayList products)29 {30 System.out.println("\nThe size of the list is " + products.size());31 for(int x = 0; x == products.size(); ++x)32 System.out.println(products.get(x));33 }34 }35//Debugging Exercises, Chapter 9;Java Programming, Joyce Farraell, 8th

Answers

Answer:

Here is the corrected code:

import java.util.*;

public class DebugNine36 {  //class name

  public static void main(String[] args)    {  //start of main method

     ArrayList<String>products = new ArrayList<String>();  //creates an ArrayList of type String names products

     products.add("shampoo");  //add shampoo to product array list

     products.add("moisturizer");  //add moisturizer product array list

     products.add("conditioner");  //add conditioner product array list

     Collections.sort(products);  //sort the elements in products array list

     display(products);  //calls display method by passing products array list

     final String QUIT = "quit";  //declares a variable to quit the program

     String entry;  //declares a variable to hold product/element or quit

     Scanner input = new Scanner(System.in);  //creates Scanner object

     System.out.print("\nEnter a product or " + QUIT + " to quit >> ");  //prompts user to enter a product or enter quit to exit

     entry = input.nextLine();  //reads the entry value from user

     while(!entry.equals("quit"))       {  //loops until user enters quit

        products.add(entry);  //adds entry (product) to products array list

        Collections.sort(products);  //sorts the elements in products array list

        display(products);  //calls display method by passing products arraylist

        System.out.print("\nEnter a product or " + QUIT + " to quit >> ");  //keeps prompting user to enter a product or enter quit to exit

        entry = input.nextLine();        }    }  //reads the entry value from user

  public static void display(ArrayList products)    {  // method to display the list of products

     System.out.println("\nThe size of the list is " + products.size());  //displays the size of the array list named products

     for(int x = 0; x < products.size(); ++x)  //iterates through the arraylist products

        System.out.println(products.get(x));    }  } //displays each item/element in products array list

Explanation:

In the code the following statement are corrected:

1.

ArrayListproducts = new ArrayList();

This gave an error: cannot find symbol

This is corrected to :

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

2.

         products.add(shampoo);

         products.add(moisturizer);

         products.add(conditioner);

Here shampoo moisturizer and conditioner are String type items that are to be added to the products so these strings have to be enclosed in quotation marks.

This is corrected to :

     products.add("shampoo");

     products.add("moisturizer");

     products.add("conditioner");

3.

display();

This method is called without giving any arguments to this method. The method display takes an ArrayList as argument so it should be passed the arraylist products to avoid error that actual and formal argument lists differ in length .

This is corrected to :

display(products);

The screenshot of output is attached.

What is one way to calm your feelings before taking
a test?

Answers

Answer:

For me I chew gum if avaliable and if it's not I think of something funny

Explanation:

QUICK!!!

Which of the following occupations would work with oceanographers to better understand the relationship between the ocean and the
atmosphere?
1.research meteorologist
2. broadcast meteorologist
3. atmospheric scientist
4. forensic meteorologist

Answers

Answer:

I think the answer would be C. atmospheric scientist

Assume that at time 5 no system resources are being used except for the processor and memory. Now consider the following events:
At time 5: P1 executes a command to read from disk unit 3.
At time 15: P5’s time slice expires.
At time 18: P7 executes a command to write to disk unit 3.
At time 20: P3 executes a command to read from disk unit 2.
At time 24: P5 executes a command to write to disk unit 3.
At time 28: P5 is swapped out.
At time 33: An interrupt occurs from disk unit 2: P3’s read is complete.
At time 36: An interrupt occurs from disk unit 3: P1’s read is complete.
At time 38: P8 terminates.
At time 40: An interrupt occurs from disk unit 3: P5’s write is complete.
At time 44: P5 is swapped back in.
At time 48: An interrupt occurs from disk unit 3: P7’s write is complete.
For time 37, identify which state each process is in. If a process is blocked, further identify the event on which it is blocked.

Answers

Answer:

Follows are the solution to this question:

Explanation:

In Time = 22:

The P5 and P8 are in the ready/running state, and the P1, P3, P7 are into the block state for Input/output.

In Time = 37:

The P1, P3, P8 are in the ready/running state, P5 is in the block state. It suspends or swapped out, and P7 is on the block state for Input/output.  

In Time= 47:

The P1, P3, and P5 are in the ready/running state, P7 is on the block state for Input/output, and P8 is in the exit state.

The trigonometry book says: sin^2(t) + cos^2(t) = 1 Write a Python program that verifies the formula with the help of the Python Math module. Note that the trigonometric functions in the module act on the angles in radians. Your program should perform the following steps 3 times: 1. Pick a random number between 0 and 180 degrees representing an angle in degrees, say Dangle 2. Convert the angle from degrees to radians, say Rangle 3. Use the Math module to find and print the values of sin(Rangle) and cos(Rangle), and 4. Compute and print the value of the above expression: sin^2(Rangle) + cos^2(Rangle). You can then visually verify if the result printed is 1 (or close to it).

Answers

Answer:

If you open your python-3 console and execute the following .py code you will have the following output. (Inputing 20 e.g)

Write the angles in degrees: 20

radian angles is:  0.3490658503988659

cosene( 0.3490658503988659 ) =  0.9396926207859084

sine( 0.3490658503988659 ) =  0.3420201433256687

sin^2( 0.3490658503988659 ) + cos^2( 0.3490658503988659 ) =  1.0

Explanation:

Code

import math

for i in range(1,4):

   angle = int(input('Write the angles in degrees: '))

   #mat library better works with radians

   angle_radians = (angle*math.pi)/180

   #print output

   print('radian angles is: ',angle_radians)

   print('cosene(',angle_radians,') = ',math.cos(angle_radians))

   print('sine(',angle_radians,') = ',math.sin(angle_radians))

   res = (math.sin(angle_radians))**2 + (math.cos(angle_radians))**2

   print('sin^2(',angle_radians,') + cos^2(',angle_radians,') = ',res)

How does multimedia content enhance a user’s Web browsing experience?

Answers

Answer:

hi

Explanation:

89

Answer:

I would say it is more engaging and helps the user remember the content better as multimedia is more memorable than just plain text. It can also display things that plain text is unable to, such as sounds and detailed pictures.

Explanation:

You are given the program to support the management of a movie rental place
You are required to perform refactoring on that program to improve its quality. You are encouraged to use refactoring services in IDEs such as Eclipse or IntelliJ.
Then, you are required
1) to add a main() method to test the program; and
2) to add a new method to print the statement for a customer in XML format, e.g., John Smith , Independent Day , etc. Please submit your resulting code
Your solution must at least contain:
1. At least 3 method extraction operations
2. At least 3 creation of 3 new classes
3. At least 3 moving method operations
4. At least 3 renaming operations

Answers

Answer:

to add a main loop

Explanation:

What is troubleshooting?

creating a checklist
finding and fixing a problem
scanning for viruses
performing regular maintenance

Answers

Finding and fixing a problem
The answer is finding and fixing a problem.
Other Questions
help me you guys so my diet is based on junk food now what can I do to improve it ?? How are plant and animal cells different in size and shape what are some 3 different examples of HOW the North Korean government uses propaganda? Define and describe violence against children ill make brainllest if right As used in paragraph one, the word objective meansQuestion 3 options:a) anxiousb) involved.c) unpleasantly critical.d) not influenced by emotions. GUYYYYYSSSSSSS ! Does anyone know how to screenshot on a windows 10 pro education computer ? What belief about humans influenced Han Feizi in the development of Legalism?Humans must be educated to rebel.Humans must be bribed to be loyal.Humans must be forced to act right.Humans must be paid to follow rules. the density of a wooden block that has a volume of 5 cm3 & a mass of 30.5 gFormula: ____________ Mass = ____Volume = ____Density = ____ (2.10-6) (6 10^7)=__ Mr. Townsend needs to make 13 pairs of butterfly wings for costumes for a pay. Each pair of wings is made with 3/4 yard of fabric. The fabric costs $8 per yard.You'll apply properties of multiplication in the following questions to find the total cost of the fabric.2. Multiply the amount of fabric by the price per yard to find an expression for the total cost. Show your work. Prince Corporation acquired 100 percent of Sword Company on January 1, 20X7, for $19 1,000. The trial balances for the two companies on December 31, 20X7, included the following amounts: Prince Corporation Sword Company Debit Credit Debit Credit Cash $94,000 $39,000 Accounts Receivable 53,000 58,000Inventory 188,000 108,000Land 92,000 34,000Buildings and Equipment 494,000 161,000 Investment in Sword Company 217,000 Cost of Goods Sold 494,000 257,000 Depreciation Expense 24,000 14,000 Other Expenses 74,000 74,000Dividends Declared 56,000 26,000Accumulated Depreciation $151,000 $70,000Accounts Payable 64,000 28,000Mortgages Payable 189,000 141,000Common Stock 294,000 45,000Retained Earnings 348,000 84,000Sales 685,000 403,000Income from Sword Company Prince Corporation 55,000 $1,786,000 $1,786,000 $771,000 $771,000Additional Information 1. On January 1, 20X7, Lime reported net assets with a book value of $150,000. A total of $20,000 of the acquisition price is applied to goodwill, which was not impaired in 20X7. 2. Lime's depreciable assets had an estimated economic life of 11 years on the date of combination. The difference between fair value and book value of tangible assets is related entirely to buildings and equipment. 3. Jersey used the equity method in accounting for its investment in Lime. 4. Detailed analysis of receivables and payables showed that Sword owed Prince $23,000 on December 31, 20x7.Required:Prepare all consolidating entries needed to prepare a full set of consolidated financial statements for 20x7 What part of the atom is responsible for the behavior of the alpha particles? Find the zeros of r(x) = 8x2 + 4x +5. will give brainlestI lived first in a little house, And lived there very well; I thought the world was small and round, And made of pale blue shell. I lived next in a little nest, Nor needed any other; I thought the world was made of straw, And brooded by my mother. One day I fluttered from the nest To see what I could find. I said, The world is made of leaves; I have been very blind. At length I flew beyond the tree, Quite fit for grown-up labours.I dont know how the world is made, And neither do my neighbours!Read the passage on the left to answer the following questions:3) What is the main image of the second stanza?A) lots of leaves everywhere B) a baby bird feeling safe inside its nest C) feelings of warmth and security inside a pale blue shell D) an eye-opening experience of viewing the world for the first time What is the image of the point (-5, -8) when rotated 90 degrees anticlockwise about the origin?(-5, -8)(5, 8)(8, 5)(8, -5) A group of workers can plant 56 acres in 7 days what is their rate in acres per day? Ques You are responding to a friend when he or she asks you, Cmo ests? You respond, Muy blen, graclas, y ? OA. ustedes OB. vosotros OC. usted O D. tu Select ALL the correct answers.Some individuals of a particular species of sea bird underwent a genetic mutation that resulted in larger beaks. The larger size of beaks helpedthese birds to break open dams and other mollusks for food. It also helped them defend themselves against predators. After many generations,almost all of the birds in the population had big beaks. For which two reasons did this phenomenon occur?A. natural selectionB. mechanical IsolationC. prezygotic barriers to reproductionD. high genetic variation in the species Which statement best states a central idea of the text?Facing obstacles in life makes life more exciting and adventurous.Planning is important for a successful life. Good things can happen when plans for the future change.Too many plans in life prevent people from being happy and fulfilled.For The Story:A Complication or TwoThe rejection letter from my Ivy League school of choice was the first major obstacle I encountered in my grand 10-year plan. It was not the last. I was 17, and at the time quite certain that nothing would derail me from my grandiose future. I planned to achieve everything my parents expected, and more. The first step was supposed to have been attending my parents alma mater, graduating with honors, and then moving on to law school without pausing to let my peersor competitorscatch me. To say thats not how it went is a gross understate