0% found this document useful (0 votes)
14 views1 page

Include

The document contains C code for defining a binary tree node structure with properties such as key, left and right child pointers, and height. It includes functions to calculate the height of a node and to create a new node. The code is part of a larger implementation likely related to binary trees or AVL trees.

Uploaded by

nagaraju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Include

The document contains C code for defining a binary tree node structure with properties such as key, left and right child pointers, and height. It includes functions to calculate the height of a node and to create a new node. The code is part of a larger implementation likely related to binary trees or AVL trees.

Uploaded by

nagaraju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <stdio.h> #include <stdlib.

h> struct Node { int key; struct Node *left; struct Node *right; int
height; }; int height(struct Node *N) { if (N == NULL) return 0; return N->height; } int max(int a, int b)
{ return (a > b) ? a : b; } struct Node *newNode(int key) { struct Node *node = (struct Node
*)malloc(sizeof(struct Node)); node->key = key; node->left = NULL; node->right = NULL; node->height =
1; return (node);

You might also like