![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Here is my shot at a pseudo-code
1. Pick the first element of array a
2. Calcuate the GCD(a[0],b[0]) or better yet 3. If anything is 1 pop it out of the list 4. Go through the list of elements for b with a[0] again. Do this until all elements are scanned in b. 5. Take the second element in a and repeat the process. Does this work? I shall post the code if i get a chance to implement it -SK PS: This reminds of division in high school days ;) In reply to Re^2: Algorithm for cancelling common factors between two lists of multiplicands
by sk
|
|