delete an element from an array

bearophile bearophileHUGS at lycos.com
Sun Oct 24 11:47:43 PDT 2010


Manfred_Nowak:

> arrays are computational not well suited for deleting elements, nor are 
> lists.

On the other hand dynamic arrays are handy for many other purposes. So if you have just 20 items, like some buttons of your GUI, you may want to use a dynamic array to add and remove them, especially if you have handy standard functions/methods to add and remove items. The runtime, even in Python, will never show you any slowdown. Python lists are arrays dynamic to the right, similar to D dynamic arrays, and they are handy.

So computational complexity considerations aren't the only things to keep in account when you write code.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list