About built-in AAs

bearophile bearophileHUGS at lycos.com
Tue Aug 16 17:06:19 PDT 2011


Walter Bright:

> It wasn't changed to simplify code, it was changed because it was faster.

Right.


> As for "attacks", if your code is subject to people sending it specially crafted 
> input in the hopes of making it run slowly, you can make specially crafted input 
> to make trees run slowly, too.

I think there are search trees like the Red-Black ones that guarantee a O(n ln n) worst case. I am wrong?

>Since operations such as inserting, deleting, and finding values require worst-case time proportional to the height of the tree, this theoretical upper bound on the height allows red–black trees to be efficient in the worst-case, unlike ordinary binary search trees.<

From:
http://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Properties

Bye,
bearophile


More information about the Digitalmars-d mailing list