Question: Python Pseudo-code. I need help translating pseudo-code into python code. Note: I am familiar with python but not with its pseudo code. Please help with

Python Pseudo-code.

I need help translating pseudo-code into python code. Note: I am familiar with python but not with its pseudo code. Please help with translating the following 3 questions into python code.

1. c[0...n + 1, 0...n+1] translate into python code. Also, how would you initialize it with that specification?

2. for i = 1 to n translate into python code.

3. c[i, i] = 0 translate into python code.

Below is the pseudo code in its entirety. However, I only need the 3 listed above to be translated.

Python Pseudo-code. I need help translating pseudo-code into python code. Note: I

1 DYNAMIC-ACTIVITY-SELECTOR (s, f, n) 2 let c[0..n 1, 0..n1] and act[0..n1, ..n for i-0 ton 1] be new tables 4 c[n + 1, n0 for 1-2 to n 1 for i 0 to n-1+1 10 while f[i] f[k] 12 13 14 15 16 17 18 19 if f[i] s s[k] and f[k] S s[j] and c[i, k] + c[k, j]+1> c[i c[k, j] + 1 c[i, jc[i, k] actli, j-k print "A maximum size set of mutually compatible activities has size" c[e print "The set contains PRINT-ACTIVITIES (c, act, 0, n+ 1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!