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
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
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education