From: Nick Keighley on 11 May 2010 03:48 On 10 May, 19:05, Richard Heathfield <r...(a)see.sig.invalid> wrote: > James Dow Allen wrote: > > <snip> > > > Well at least Heathfield and Seebs agree on *something*: > > We seek human cognitive advantage. > > Actually, I think Seebs and I agree on a great deal. This happens to be > something about which we mostly disagree, but even then we can find > small but significant areas of agreement, if we look hard enough. > > <snip> > > > Mr. Heathfield, IIRC, hasn't actually deigned to post an alternative. > > I'm reasonably sure I did deign to post an alternative. But I may not > have done. I may merely have posted an alternative. > > To save me finding it, however, I'll very quickly and no doubt > erroneously reconstruct it: > > found = 0; > for(x = 0; !found && x < xlim; x++) > { > for(y = 0; !found && y < ylim; y++) > { > for(z = 0; !found && z < zlim; z++) > { > if(haystack[x][y][z] == needle) > { > point_assign(p, x, y, z); > found = 1; > } > } > }} > > return found; > > Laugh away, sirrah! :-) > > <snip> > > > Hope this helps, > > Yup. Style arguments are always fun. both versions of the algorithm gave the same complexity measurement in a tool I have. They both rated 5 for cyclometric complexity.
From: Richard Heathfield on 11 May 2010 04:29 Nick Keighley wrote: <snip> > both versions of the algorithm gave the same complexity measurement in > a tool I have. They both rated 5 for cyclometric complexity. McCabe, by any chance? If so, how does the visual rep of the code come out? Which *looks* simpler? -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ "Usenet is a strange place" - dmr 29 July 1999 Sig line vacant - apply within
|
Pages: 1 Prev: Questions about my Parallel Sort Library... Next: on complexity [Was: on goto] |