December 15th, 2006, 07:09 AM
How to use shift in ML
If I have an array and I want to shift the hole array to the right or left.
shift right = a[4,1,2,3] shift left = a[2,3,4,1] any idea !!
December 20th, 2006, 03:54 PM
Originally Posted by BaAa3
I'm not all that fluent with ML anymore however, the following psuedo code should help.
last : rest_without_last
What you want to do cons's the last element into the rest of the elements, but not the last.