CA06: Sock sorter The Problem You have a mixed pile of N left socks and M right socks, where N is not equal to M: there are a few odd socks! Write a Java program to quickly find the odd socks. One way...

1 answer below »



CA06: Sock sorter


The Problem


You have a mixed pile of N left socks and M right socks, where N is not equal to M: there are a few odd socks!


Write a Java program to quickly find the odd socks. One way to do it would be to arrange them in a symbol table implementation, removing an entry when its mate is found. At the end of the program, print the odd socks out on the standard output.


You are given some text files full of socks, in the form LXXX and RYYY, where XXX and YYY are numbers. Matching socks are of the form LXXX and RXXX.


Deliverables



  1. A software design report (3 pages max! Don't include source code), laid out as follows:



    • introduction to the problem, including description of tests;


    • design of the program, including estimating the running time of your algorithm;


    • notes on the implementation (coding);


    • test results.



  2. A java source file, containing the implementation code


Notes



  1. The design is a very important part of the assignment. Consider presenting your design in the report using UML diagrams, e.g. a UML activity diagram.

  2. Marks will be awarded for good design. Consider how to match pairs of socks as quickly and efficiently as possible. Also, estimate the running time of your algorithm.

  3. If you are re-using code from the module notes or elsewhere,reference your sources!


  4. Testing is also a very important part of the assignment. Make sure you report the results of tests of your program. Four example files are available: 10socks.txt, 100socks.txt, 1Ksocks.txt and 10Ksocks.txt, to help you debug and test your code. After submission, I will test your code with a private data set to make sure the algorithm works.

Answered 5 days AfterApr 22, 2021

Answer To: CA06: Sock sorter The Problem You have a mixed pile of N left socks and M right socks, where N is...

Kshitij answered on Apr 26 2021
148 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here