[LeetCode] Convert Sorted Array to Binary Search Tree in Objective C

in programming •  8 years ago 

LeetCode Convert Sorted Array to Binary Search Tree in Objective C

typedef struct {
   int value;
   struct TreeNode *left;
   struct TreeNode *right;
} TreeNode;

-(TreeNode *)sortedArrayToBST:(NSArray *array)
{
 return sortArrayToBST:(array, 0, array.count-1);
}

-(TreeNode *)sortedArrayToBST:(NSArray *array)
{
 return sortArrayToBST:(array, 0, array.count-1);
}
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!