int wheight(struct node* root)
{
    int k, j;
    if(root == NULL)
        return 0;
    if(root->left == NULL && root->right == NULL)
        return root->height;

        j = wheight(root->left);
        k = wheight(root->right);
    if(j > k)
        return j;
    return k;
}
Example #2
0
void Zprevious_page(void)
{
	int i, col = forcecol();

	bpnttomrk(Bbuff, Sstart);
	for (i = wheight() - prefline() - 2; i > 0 && bcrsearch(Bbuff, NL); --i)
		i -= bgetcol(true, 0) / Colmax;
	bmakecol(col);
	reframe();
}
Example #3
0
void Znext_page(void)
{
	int i, col = forcecol();

	bpnttomrk(Bbuff, Sstart);
	for (i = wheight() + prefline() - 2; i > 0 && bcsearch(Bbuff, NL); --i) {
		bmove(Bbuff, -1);
		i -= bgetcol(true, 0) / Colmax;
		bmove1(Bbuff);
	}
	bmakecol(col);
	reframe();
}
int main(void)
{
    int i, j, insertnum, currentcase, k=0;
    char string[MAX_LENGTH+1];
    struct node* root = NULL;
    scanf("%d", &insertnum);
    for(currentcase = 0;currentcase < insertnum; currentcase++)
    {
        scanf("%s", string);
        root = insert(root, string, k);
    }
    int compfind = height(root, "science");//find(root, "computer", k+1);
    int hlength = wheight(root);
    printf("%d", hlength);

    return 0;
}