ITPub博客

首页 > IT职业 > IT生活 > 红黑树之歌 (转)

红黑树之歌 (转)

原创 IT生活 作者:worldblog 时间:2007-12-13 16:53:50 0 删除 编辑
红黑树之歌 (转)[@more@]--> 

The Red-Black Tree Song


[To the tune of Paint It Black, with my utmost apologies to the Rolling Stones]

I see a brand new node
I want to paint it black.

We need a balanced tree,
we've got to paint it black.

I want to find my key in log n time -- thats all,
Rotating sub-trees 'round sure can be a ball.

I see a brand new node
I want to paint it black.

Can't have a lot of red nodes,
We must paint them black.

Unfortunately, coding them can be a bitch.
If we had half a brain to splay trees we would switch.

I see a brand new node
I want to paint it black.

No time for AVL trees
we must paint it BLACK.

And if they're still confusing, you should have no fear.
Because outside this class, of them you'll never hear.

I wanna paint 'em BLACK. Paint nodes black. Again and again.

?Copyright 1995 Sean D. Sandys. You may link to this page but may not reproduce its contents in any way without the author's written peRmission.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-993011/,如需转载,请注明出处,否则将追究法律责任。

上一篇: soap监视器 (转)
请登录后发表评论 登录
全部评论
  • 博文量
    6241
  • 访问量
    2404916