You know the Pareto Principle? The 80/20 rule? That 80% of the work gets done by 20% of the people? Or 80% of the money belongs to 20% of the people? And so on?

Well it is 'recursive' inasmuch as it can be applied again to the 20% first recognised.

i.e. if 20% do 80% of the work then 20% of the 20% do 80% of they work THEY do.

And so on.

While I can get my head around recursion generally and can fully comprehend the standard recursive algorithm for calculating factorial - I'm not smart enough to put this one together. It always seems to me I have two parameters rather than just the one - the 'n' we watch in the factorial - and can't figure out how to do it.

Yep, I'm not real bright.

Can anyone do that?

JamesCherrill commented: Bright enough to know when to ask for help - that's brighter than the average! +15

Why 2 parameters? Isn't there just one (the amount to be split)?

If so you may be worrying about returning 2 values from each call, in which case:

  1. You could package the two values into an array, tuple, trivial class etc depending on your chosen language
  2. You only need to return one, because the other is (the original value to be split minus the one you return).
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.