Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You have a parking lot with parking spots numbered 1, 2, ..., n, to which n vent

ID: 3841768 • Letter: Y

Question

You have a parking lot with parking spots numbered 1, 2, ..., n, to which n venture capitalists
drive money-filled trucks of sizes a1, a2, ..., an (leaving no extra parking spaces). You’d like to sort
the trucks by size (so you can work your way down the list of trucks later talking with the venture
capitalists about their terms), but you can only see along a limited distance of the parking lot at
any one time, so (1) you can only compare the sizes of two trucks at most k parking spots away
from each other1, and (2) you can only tell trucks at distance at most k from each other( That is,
only trucks in spots i and j where |i j| k) to swap places.
a. Design an algorithm that compares two arbitrary trucks (not necessarily at distance at
most k) in O(n/k) truck swaps (each of distance at most k), and returns any trucks that
were moved in the process to their original positions.
b. Design an algorithm that switches two arbitrary trucks (not necessarily at distance at most
k) in O(n/k) truck swaps (each of distance at most k), and returns any other trucks that
were moved in the process to their original positions.
c. Describe an algorithm that sorts the trucks. You may possibly use the previous two parts

Explanation / Answer

There are numerous varieties of this issue, for example, 2D pressing, straight pressing, pressing by weight, pressing by cost, et cetera. They have numerous applications, for example, topping off compartments, stacking trucks with weight limit imperatives, making record reinforcements in media and innovation mapping in Field-programmable entryway exhibit semiconductor chip plan.

The receptacle pressing issue can likewise be viewed as a unique instance of the cutting stock issue. At the point when the quantity of receptacles is limited to 1 and every thing is portrayed by both a volume and an esteem, the issue of augmenting the estimation of things that can fit in the container is known as the rucksack issue.

In spite of the way that the receptacle pressing issue has a NP-hard computational many-sided quality, ideal answers for substantial examples of the issue can be delivered with complex calculations. Furthermore, numerous heuristics have been created: for instance, the primary fit calculation gives a quick yet frequently non-ideal arrangement, including setting every thing into the main receptacle in which it will fit. It requires (n log n) time, where n is the quantity of components to be stuffed. The calculation can be made a great deal more compelling by first sorting the rundown of components into diminishing request (now and then known as the primary fit diminishing calculation), despite the fact that this still does not ensure an ideal arrangement, and for longer records may build the running time of the calculation. It is known, in any case, that there dependably exists no less than one requesting of things that enables first-fit to deliver an ideal solution.[3]

A variation of container pressing that happens practically speaking is when things can share space when stuffed into a receptacle. In particular, an arrangement of things could involve less space when pressed together than the whole of their individual sizes. This variation is known as VM packing[4] since when virtual machines (VMs) are stuffed in a server, their aggregate memory necessity could diminish because of pages shared by the VMs that need just be put away once. On the off chance that things can share space in subjective ways, the canister pressing issue is difficult to try and inexact. In any case, if the space sharing fits into a chain of command, similar to the case with memory partaking in virtual machines, the canister pressing issue can be proficiently approximated. Another variation of receptacle pressing of enthusiasm for practice is the supposed online container pressing. Here the objects of various volume should arrive consecutively and the leader needs to choose whether to choose and pack the at present watched thing, or else to give it a chance to pass. Every choice is without review

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote