Answers for "binary tree vs binary search tree"

7

binary tree vs binary search tree

Binary tree - each node can have at most 2 nodes, Binary Search tree - is a binary tree and put smaller values on the left and larger values on the right of the root.
Posted by: Guest on November-27-2019
1

binary search tree

# Driver Code 
arr = [ 2, 3, 4, 10, 40 ] 
x = 10
  
# Function call 
result = binarySearch(arr, 0, len(arr)-1, x) 
  
if result != -1: 
    print ("Element is present at index % d" % result) 
else: 
    print ("Element is not present in array")
Posted by: Guest on December-09-2020

Browse Popular Code Answers by Language