Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

I have three algorithms for computing the reflexive transitive closure of R* R*={(a,b): a,b ε A and there is a path from a to b in R} Algorithm #1 Initially R*:= 0 for i=1,.....,n do for each tuple(b1,....,bi) ε A^i do if(b1,....,bi) is a path in R then add (b1,bi) to R* Algorithm #2 Initially R* := R U {(ai,ai) :ai ε A} while there are three elements ai,aj,ak ε A such that (ai,aj),(aj,ak)ε R* but(ai,ak) not ε R* do: add(ai,ak) to R*

OpenStudy (anonymous):

Algorithm #3 Initially R* := R U {(ai,ai): ai ε A } for each j=1,2,....,n do for each i=1,2,....,n do if(ai,aj),(aj,ak) ε R* but (ai,ak) not ε R* then add (ai,ak) to R* Could you please explain those algorithms to me and send a code(in java or c) for each of them? Thank you!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!