Help for this page

Select Code to Download


  1. or download this
    function reverse_in_place(a[0 .. (n - 1)])
    
  2. or download this
    function reverse_in_place(a[0 .. n])
        for i from 0 to floor( ((n + 1) / 2) - 1 )
            tmp  := a[i]
            a[i] := a[n - i]
            a[n - i] := tmp
    
  3. or download this
    use strict;
    use warnings;
    ...
    
        return join('', @array);
    }