Employer Engaged

Interview Question

Software Development Intern Interview

how to find the end of a singly linked-list, height of a

  binary tree.

Interview Answer

1 Answer


node* p = head;
while(p->next != NULL){
     p = p->next;

if its a complete binary tree: height = floor(log2(n))

Anonymous on Nov 24, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.