Write a function to find the depth of a binary tree.
Answer Posted / hithere
int depth(treenode *p)
{
if(p==NULL)return -1 ;
int h1=depth(p->left);
int h2=depth(p->right);
return(max(h1,h2)+1);
}
in case where p has no child but is not NULL itself, it
should return 0.
| Is This Answer Correct ? | 13 Yes | 12 No |
Post New Answer View All Answers
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
Sir... please give some important coding questions asked by product companies..
Write a routine to implement the polymarker function
#include
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
could you please send the program code for multiplying sparse matrix in c????
Write a program to model an exploding firecracker in the xy plane using a particle system
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
write a program for area of circumference of shapes
Develop a routine to reflect an object about an arbitrarily selected plane
Design an implement of the inputs functions for event mode
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.
why nlogn is the lower limit of any sort algorithm?
Cluster head selection in Wireless Sensor Network using C programming language.