Menu

[Solved] Given three groups of boxes A, B, and C of n boxes each, where the shapes of the boxes are different

Given three groups of boxes A, B, and C of n boxes each, where the shapes of the boxes are different. The capacity of each box is measured in milliliter (ml). The list of boxes’ capacities in Group A is exactly randomly repeated in Group B and C. This means that for each box in Group A there exist a corresponding box in Group B and C that hold the same capacity, but we do not know which box would match with the other in group A, B and C. Your mission is to find a smart way to match these boxes.

\[ - \] Input: capacity in milliliter

Output: A[1] with B[3] with C[6]

A[2] with B[6] with C[1]

A[3] with B[2] with C[4]

… and so on a)

a)Using a brute-force approach, design an algorithm to solve this problem, and analyze its complexity

b) Design a more efficient algorithm to solve this problem, and analyze its complexity [Hint: you can use any data-structure]

c) Implement your efficient algorithm using Python

d) Prepare a brief report (250 words) comparing the two algorithms

Expert Answer


Answer to Given three groups of boxes A, B, and C of n boxes each, where the shapes of the boxes are different. The capacity of each box is measured…

OR


Leave a Reply

Your email address will not be published. Required fields are marked *