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.
defcheck_binary_search_tree_(root):# create helper functiondefcheck(root,min_value,max_value):# base caseifrootisNone:returnTrue# general caseifroot.data<min_valueorroot.data>max_value:returnFalsereturncheck(root.left,min_value,root.data-1)andcheck(root.right,root.data+1,max_value)returncheck(root,0,10000)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →