in reply to Re^2: Check if string A and B are made up of same chars
in thread Check if string A and B are made up of same chars

The performance of those algorithms depends a lot on the quality of the input.

Like

For instance a linear approach like mine will most likely dominate for longer strings, which are equal.

But how likely are a bunch of totally random long strings ever to be equal???

That's a microscopic chance, and any algorithm which is managing to opt out as early as possible will dominate, little matter the complexity of the approach in total.

So first task:

define the problem space and provide a generator to create representative input.

Second task:

write a Benchmark suite based on this input.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

  • Comment on Re^3: Check if string A and B are made up of same chars