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. For example: 7 5 A B C Group A 2 8 3 Input: capacity in milliliter Group 1 2 120 150 140 170 120 90 6 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 3 150 140 200 Group B 2 4 100 90 150 7 5 5 170 100 180 6 200 120 140 1 7 7 90 Group C 8 180 180 200 100 170 2 s 8 3 6 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
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.
For example:
Group A
Input: capacity in milliliter
Group 1
A
B
C
140
170
120
2
120
150
90
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
3
150
140
200
Group B
4
100
90
150
5
170
100
180
6
200
120
140
7
7
90
180
100
Group C
c) Implement your efficient algorithm using Python
d) Prepare a brief report (250 words) comparing the two algorithms
8
180
200
170
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]
Transcribed Image Text: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. For example: Group A Input: capacity in milliliter Group 1 A B C 140 170 120 2 120 150 90 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 3 150 140 200 Group B 4 100 90 150 5 170 100 180 6 200 120 140 7 7 90 180 100 Group C c) Implement your efficient algorithm using Python d) Prepare a brief report (250 words) comparing the two algorithms 8 180 200 170 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]
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Minimum and Maximum
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education