"I'm not back." - Bill Harding, Twister
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
In which case, does the following count?I don't like sorting the array as a solution. I think the original question was more a party piece than proper programmingLes Morgan wrote:it is going to depend on the definition of loop . . ..
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
You can prove that iteration and recursion are semantically equivalent. As I said earlier, this is a party trick and not programming. Math#max uses ?: behind the scenes, which is equivalent to an if‑else.Antonio Moretti wrote:. . . Recursion, is by definition, not a iteration and therefore not a loop . . .
Campbell Ritchie wrote:
You can prove that iteration and recursion are semantically equivalent. As I said earlier, this is a party trick and not programming. Math#max uses ?: behind the scenes, which is equivalent to an if‑else.Antonio Moretti wrote:. . . Recursion, is by definition, not a iteration and therefore not a loop . . .
Because somebody else asked him how he would implement that.Antonio Moretti wrote:. . . I wondered why he ask the question . . .
Keshini Weerasuriya wrote:Is thr any way of finding the maximum and minimum of an array without using any loops, or if conditions??
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |