-3
$\begingroup$

If I have a sorted array of size $n$, can I build a Red Black tree out of it in $O(n)$ time in a different algorithm rather than splitting the tree in half every time or the straightforward way that was mentioned in one of the answers?

$\endgroup$
  • $\begingroup$ @Trinarics And when the next answer comes along, will you again modify your question to ask for something else? $\endgroup$ – FrankW Jun 2 '14 at 13:25
  • $\begingroup$ @FrankW no because that answer was what I have heard in class and I forgot to mention that I am looking for something different than it. $\endgroup$ – HaloKiller Jun 2 '14 at 13:27
3
$\begingroup$

This can be done in a very straightforward way: Just build an almost complete tree and make the nodes on the lowest level red.

| cite | improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.