RE: [PHP] the SkyBiz matrix|downline program using PHP & mySQL
| From: | Don Read | Date: | Thu, 26 Apr 2001 00:18:51 +0000 |
| Subject: | RE: [PHP] the SkyBiz matrix|downline program using PHP & mySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50393@lists.php.net to get a copy of this message | ||
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 dread@texas.net
-- 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.