Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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
 

For example: 7 5 A B C Group A Input: capacity in milliliter Group 1 140 170 120 6 2 120 150 90 3 150 140 200 Group B 4 100 90 150 2 5 170 100 180 8 6 200 120 140 7 7 90 180 100 Group C OB 8 180 200 170 5 8 3

Step by Step Solution

3.42 Rating (161 Votes )

There are 3 Steps involved in it

Step: 1

Answer 1 General guidance The answer provided below has been developed in a clear step by step manner 2 Step By Step Step 1 A Create an algorithm to t... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability And Statistics

Authors: Morris H. DeGroot, Mark J. Schervish

4th Edition

9579701075, 321500466, 978-0176861117, 176861114, 978-0134995472, 978-0321500465

More Books

Students also viewed these Accounting questions

Question

What is the OMB Compliance Supplement? What is its purpose?

Answered: 1 week ago

Question

What is a role model? (p. 8)

Answered: 1 week ago

Question

Distinguish between prejudice and discrimination.

Answered: 1 week ago