[your code here]

Manfred Nowak svv1999 at hotmail.com
Sat Feb 4 20:05:01 PST 2012

Jos van Uden wrote:

> bool isPangram

The presented code is not an acceptable example for the usage of the D 
programming language.

`indexOf( s, c)' has a worst case running time of O( `s.length'). 
`indexOf' is called once for each `c' in the used member `alpha' of 
Therefore the runtime of the presented code is
  O( `s.length' * `alpha.length')
  O( `s.length' + `alpha.length')
is possible.

The optional third parameter of `indexOf' can be called with 
`CaseSensitive.no'. But that parameter is left untouched. Instead a 
check with `toUpper( c)' is used, thereby risking a further visitation 
of the whole string .
The use of the literal value `-1' stands out of the code and hints to a 
maldesign in phobos. This is because `-1' is not mnemonic.


More information about the Digitalmars-d mailing list