Example #1
0
Link* Link::find_lower(Link *n)
{
	Link* p = this;

	while (p->level > n->level - 1 && p->level > 1) p = p->to_first_total(); // Ведём поиск на уровне ниже, p->level - 1

	while (p)
	{
		if (p->level == n->level && p->value == n->value) return p;
		p = p->advance();
	}

	return 0;
}
Example #2
0
Link* Link::find_duplicate(Link *n)
{
	Link* p = this;

	p = p->to_first_total();

	while (p)
	{
		if (p->level == n->level && p->value == n->value) return p;
		p = p->advance();
	}

	return 0;
}
Example #3
0
Link* Link::find_total(Link *n)
{
	if (n == 0) return this;

	Link* p = this;

	p = p->to_first_total();

	while (p)
	{
		if (n->level == p->level && n->value == p->value) return n;
		p = p->advance();
	}

	return 0;
}