Question: python Write the function isBST(t) that receives a binary tree t and determines if t is a binary search tree. For example, your function should

 python Write the function isBST(t) that receives a binary tree t

python

Write the function isBST(t) that receives a binary tree t and determines if t is a binary search tree. For example, your function should return True if it receives the tree on the left and False if it receives the tree on the right (since key 68 is on the left subtree of key 66 ). Do this by extracting the in-order traversal of the tree to a Python list and checking to see if the list is sorted. Your function must run in time O(n) (no cred will be given if it takes longer than that)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!