The Ham Supper You're at a holiday supper where the hosts are serving far too much ham. After the supper, you're asked to take care of cleaning the dishes. However, one of your relatives tells you that the dishes can only be cleaned in the sink if their ham-ing distance is the length of the input serial number when compared with all other dishes, otherwise, they can be cleaned in the dish washer if any distance is less than the length of the serial number. A ham-ing distance is a count of the numbers that are different in the same positions. The ham-ing distance can be found by comparing the serial numbers of each of the dishes. For instance, two cups have serial numbers 0010, and 1214 meaning they have a hamming distance of 3. Therefore, they they be cleaned in the dish washer. With an additional plate that has a serial number of 3897, it would need to be cleaned in the sink as it's hamming distance is 4, or equal to the length of the serial numbers when compared to the others. The input list given with this assignment can be used to find all the serial numbers of all the dishes. Provide general code that computes, and outputs the sum of the serial numbers to be cleaned in the dish washer, and the sum of the serial numbers to be cleaned in the sink. Additionally, provide code that is specific to this input which can find the sums with a linear time complexity O(n), where n is the number of elements in the input list. Testing Include testing for this specialized code, as well as the generalized code. There are no specific guidelines for testing. However, they should probe edge cases, and be triggered automatically when the main function is run.
The Ham Supper You're at a holiday supper where the hosts are serving far too much ham. After the supper, you're asked to take care of cleaning the dishes. However, one of your relatives tells you that the dishes can only be cleaned in the sink if their ham-ing distance is the length of the input serial number when compared with all other dishes, otherwise, they can be cleaned in the dish washer if any distance is less than the length of the serial number. A ham-ing distance is a count of the numbers that are different in the same positions. The ham-ing distance can be found by comparing the serial numbers of each of the dishes. For instance, two cups have serial numbers 0010, and 1214 meaning they have a hamming distance of 3. Therefore, they they be cleaned in the dish washer. With an additional plate that has a serial number of 3897, it would need to be cleaned in the sink as it's hamming distance is 4, or equal to the length of the serial numbers when compared to the others. The input list given with this assignment can be used to find all the serial numbers of all the dishes. Provide general code that computes, and outputs the sum of the serial numbers to be cleaned in the dish washer, and the sum of the serial numbers to be cleaned in the sink. Additionally, provide code that is specific to this input which can find the sums with a linear time complexity O(n), where n is the number of elements in the input list. Testing Include testing for this specialized code, as well as the generalized code. There are no specific guidelines for testing. However, they should probe edge cases, and be triggered automatically when the main function is run.
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
Can yo do this in C++, here are the input : 41360114 48648110 11036224 83620684 11806064 22036266 66830416 44168838 41664810 36310244 83033068 03631826 46112613 06831181 12200621 03846661 11141362 04624101 82340210 30634203 38034162 68036462 02614316 08800136 83688326 40602830 63321231 81044114 20012082 21014838 21081200 36068048 64120020 32311142 42400042 86322306 68108012 20380100 43116446 13323000 44080311 16411816 32020468 42838624 88826006 28360306 30822218 13683682 04801288 10428026 23386111 33113860 02288384
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
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