#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0

    Small project- Job list


    Conditions: Have to use JAVA, no use of database.

    Imagine we have a list of jobs, each represented by a character. Because certain jobs must be done before others, a job may have a dependency on another job. For example, a may depend on b, meaning the final sequence of jobs should place b before a. If a has no dependency, the position of a in the final sequence does not matter. These jobs would be input with a simple text box (also how does one store multiple variables)

    Given the following job structure:

    a =>
    b =>
    c =>
    The result should be a sequence containing all three jobs abc in no significant order.

    Given the following job structure:

    a =>
    b => c
    c => f
    d => a
    e => b
    f =>
    The result should be a sequence that positions f before c, c before b, b before e and a before d containing all six jobs abcdef.

    Given the following job structure:

    a =>
    b => c
    c => f
    d => a
    e =>
    f => b
    The result should be an error stating that jobs canít have circular dependencies.

    Just wondering if anyone could give me a few ideas of how I would go about doing this?

    Any help is welcomed, Cheers.
  2. #2
  3. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Feb 2004
    Location
    Mobile, Alabama
    Posts
    4,023
    Rep Power
    1285
    You might consider using a TreeMap

IMN logo majestic logo threadwatch logo seochat tools logo