in reply to How do i sort an numeric array without using sort function. Is ther any way to sort it just with loop in perl??

You might implement a quick sort algorithm (coded in functional style):
sub qsort { return @_ if @_ < 2; my $pivot = pop; qsort(grep $_ < $pivot, @_), $pivot, qsort(grep $_ >= $pivot, @_); }
Check quick sort on Wikipedia to understand how it works.
  • Comment on Re: How do i sort an numeric array without using sort function. Is ther any way to sort it just with loop in perl??
  • Download Code

Replies are listed 'Best First'.
Re^2: How do i sort an numeric array without using sort function. Is ther any way to sort it just with loop in perl??
by Tabish (Acolyte) on Nov 03, 2017 at 09:20 UTC

    Thank you, i did it