Sollicitatievraag bij Amazon

How can you construct a balanced binary search tree when you're given a sorted array.

Antwoord op sollicitatievraag

Anoniem

15 jan 2021

create a recursive function that sets the parent node to the midpoint array and the left child is the recursive call of first half of the array, right child is 2nd half of the array.