Watch this video in a new window

Red-Black tree example

A red-black tree: The insertion sequence is 10,85,15,70,20,60,30,50,65,80, 90,40,5 and 55  
 
Customize

More From: rationalpsychedelia

Loading...

QuickList(0)

Upgrade to Flash Player 10 for improved playback performance. Upgrade Now or get more info.
34 ratings
Sign in to rate
26,197 views
Want to add to Favorites? Sign In or Sign Up now!
Want to add to Playlists? Sign In or Sign Up now!
Want to flag a video? Sign In or Sign Up now!

Statistics & Data

Loading...

Video Responses (0)

This video has no Responses. Be the first to Post a Video Response.
Sign in to post a Comment

Text Comments (25)   Options

Loading...
prafonio (4 days ago) Show Hide
 0
Marked as spam
The max difference of one it's supposed for the AVL Tree..
Be attention because this is a Red-Black Tree and I think that hasn't the same proprieties..
Pondenome (1 month ago) Show Hide
 0
Marked as spam
I am sincerely regretful. The worst joke ever.
YousefAB (2 months ago) Show Hide
 0
Marked as spam
At 0:56 the right side of the tree has a height of 4 (starting with 0) and the left side has 2, thats a difference of two. Isn't it suppose to be a max difference of one?
raviney (2 months ago) Show Hide
 0
Marked as spam
You're thinking of an AVL tree. For red black trees, the longest path can be up to twice as long as the shortest path
YousefAB (2 months ago) Show Hide
 0
Marked as spam
Fair enough, one question, why did it balance at 0:20, left side has L = 2, right side L = 4. so I'm just wondering why did it balance?
awakeTooOften (2 weeks ago) Show Hide
 0
Marked as spam
@YousefAB : You're thinking of an AVL tree, not a red/black tree.
NyRamsey (6 months ago) Show Hide
 0
Marked as spam
i was under the imprression that leaves were suposed to be black. can someone clarify?
maxmoon2009 (6 months ago) Show Hide
 0
Marked as spam
The leaves are not normally shown. They contain the value NIL.
NyRamsey (6 months ago) Show Hide
 0
Marked as spam
got it, thanks.
asdrubal121 (2 months ago) Show Hide
 0
Marked as spam
the null pointers are black, wich in some books are leafs

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.