红黑树之歌

王朝other·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

--

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.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航