We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I wrote a routine that recursively searched the left child or the right child (if not in the left child) for the value. I initially thought that this should have a logarithmic run time but on second thoughts, in a worst case scenario, it may be even worse than linear time.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
QHEAP1
You are viewing a single comment's thread. Return to all comments →
Darn! I thought I was being clever.
I wrote a routine that recursively searched the left child or the right child (if not in the left child) for the value. I initially thought that this should have a logarithmic run time but on second thoughts, in a worst case scenario, it may be even worse than linear time.