-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$

closed as unclear what you're asking by D.W., David Richerby, Juho, Wandering Logic, Joe Jun 3 '14 at 17:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\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.

$\endgroup$

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