Question: LIST CONCATENATION - - [ 1 , 2 , 3 ] + + [ 2 , 3 , 4 ] = [ 1 , 2
LIST CONCATENATION
LIST PREPENDING
:
LIST APPENDING
: WRONG
: : :
LIST FUNCTIONS
head
tail
length
filter x x
reverse
map reverse abc "def", "ghi"cba "fed", "ihg"
LIST COMPREHENSIONS
even x x
Use the above functions to achieve the specified goals.
For each function write its type signature if not present.
Problem A Write a function that takes a list and puts the last two elements
at the front of the list, in their original order. For lists of size
one, return the original list. For empty lists, return the empty list.
ex:
INPUT: funca
OUTPUT:
INPUT: funca "ceni"
OUTPUT: "nice"
INPUT: funca
OUTPUT:
PUT THE LAST TWO LIST ELEMENTS AT THE FRONT OF THE LIST
pts
funca :: aa
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
