pseudocode algorithm

Jun 25, 2013 at 1:37pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

    int Minimum-Cost( X[a..d], person )

          min ← ∞

          if person = d then return cost(X)          -- Bottom of space, d has been assigned

          else

                 for Job ∈ {1, 2, 3, 4 } do

                    if not assigned(X, Job)

                        X[person+1] ← Job

                        tempmin ← Minimum-Cost( X[a..d], person+1 )

                        if tempmin < min then min ← tempmin

                        X[person+1] ← ∅

                 return min

    cost( X ) returns cost of assigning Job 1..4 to person a..d

    assigned( X, Job ) returns true if Job is assigned person a..d


the First parameter is an array right? can i ask that what is the person type will be? possible ?

Jun 25, 2013 at 2:06pm
Ok, I'm taking a close look at your assignment, later...

can i ask that what is the person type will be?
Well, look at line 6. It is compared with the index of the column. It is used on line 14 as such.
Jun 25, 2013 at 3:41pm
just sent and message for you. tried to do my best which i could...
yea i know. just don't know how the implement in real will be for recursive
Topic archived. No new replies allowed.