Try this:
Update: Perhaps my answer wasn't so helpful to you as i intended, sorry.
You wrote: "At first, I want to begin by generating a test set for N integer numbers..."
So i just wanted to show a way to generate such a randomized test set. I hope very much that i didn't confuse you.
#!/usr/bin/perl use strict; use warnings; #...get a seed open(RANDOM, "<", "/dev/random") or die $!; read(RANDOM, $_, 4); close RANDOM; srand(unpack("L", $_)); #...do the shuffle my @k = ( 1..10 ); for ( my $i = @k ; --$i ; ) { my $j = int( rand( $i + 1 ) ); next if $i == $j; @k[ $i, $j ] = @k[ $j, $i ]; } print join( " ", @k) . qq(\n); #...and give your custom sort a chance
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
In reply to Re: How to generate test data?
by karlgoethebier
in thread How to generate test data?
by abdullah.yildiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |