Domanda di colloquio di Twilio

Array-to-Tree Write a function that given an array representation of a binary tree will convert it into a typical tree format. The following is a visual representation of expected input and output: Input: [7, 3, 9, 2, 4, 8, 10] Output: 7 / \ 3 9 /\ /\ 2 4 8 10 Hint: left child index: current_index * 2 + 1 right child index: current_index * 2 + 2

Risposta di colloquio

Anonimo

8 ott 2018

Level Order Traversal...