On 25-Apr-01 Thomas Edison Jr. wrote:
> we're trying to develop an exact replica of the SkyBiz
> downline|Matrix system program. But it's getting so
> complicated & niether is the logic coming out. we're
> in need of help. Anyone familiar with the skybiz
> matrix, please help!!
> It's a 2 X 2 matrix system where a person can have
> only two legs below him - Left & Right = and thus the
> chain grows. Each person sponsors 2 people below him.
> They can be directly below him or somewhere down the
> line.
Not a matrix, it's called a Binary Tree (B-Tree); programming 101.
also look for "recursion" near-by.
N
/ \
K Q
\
S
/ \
R T
func count(x) {
if (x == NULL)
return(0);
cnt=1 + count(x->left) + count(x->right);
return(cnt)
}
> But keeping a count of how many people o one's
> right & left is getting impossible logically.
> please help!
I'd kinda imagine it would.
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]