Intuit

  www.intuit.com
  www.intuit.com

Interview Question

Software Development Intern Interview

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

  binary tree.
Answer

Interview Answer

1 Answer

0

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.