Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Help!?

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Help!?

    There is an attachment already. I am a beginner and i have no idea what my professor is asking me for. Can someone please help me. Please look at the attachment.



    Oh no! Disaster has struck some of company XYZ's redundant data centers. The administrators have managed to restore backups, but some data sets are still missing from some data centers. Fortunately, every data set can be found at least once in one or more of the data centers. However, before XYZ can resume normal operations, it needs to ensure that each data center has a copy of every data set. Your goal is to help XYZ resume normal operations by writing a program to synchronize data sets between data centers using as few copies as possible.
    Input:
    ------
    The first line of input will contain an integer between 0 and 999999 inclusive, representing the number of data centers. Following that will be one line of input for each data center. Each line will contain an integer representing the number of data sets at that data center, followed by a space and space-separated list of data set ids currently present at that data center. Data set ids are each an integer between 1 and 999999, inclusive. Each line will be at most 999 characters long. Data set ids are not necessarily consecutive. The list of data sets will not be in any particular order.
    Output:
    -------
    The program must output an optimal data set copy strategy to ensure that every data center has a copy of every data set. Output one line for every copy instruction. A copy instruction is of the form <data-set-id> <from> <to>, where <data-set-id> is the data set id, <from> is the index of the data center the data set will be copied from (1 = the first data center), and <to> is the index of the data center to copy the data set to. When there are no more copy instructions, the program must output the word "done" on a line by itself.
    There is often more than one correct output with minimal number of operations for a given input, and any output that satisfies the requirements is valid.
    Constraints:
    ------------
    The code you submit must take input from stdin and produce output to stdout as specified above. No other output is permitted. You can assume the input will be valid. In the examples below, the text
    "Input:" and "Output:" (or "One Possible Correct Output:") are not part of the output, and neither are the blank lines.
    Attached Files Attached Files

  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help!?

    i have no idea what my professor is asking me for.
    Then you should ask your professor or the TAs for help.

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Help!?

    I think what is asked for is straightforward. You just need to figure out how to implement what the professor is asking.

  4. #4
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help!?

    Can someone atleast help me get started.