Define a recursive function flip in scheme which accepts


Define a recursive function flip in Scheme which accepts a list of atoms of arbitrary length as its only argument and returns that list with adjacent elements flipped. In other words, the function alternates elements of a list (i.e., given a list [a1,a2,a3,a4,a5,a6...,an] as an argument,produce [a2,a1,a4,a3,a6,a5,...]). If n is odd, an remains at the end of the resulting list. You must not use any auxiliary functions. Examples (in Scheme):
> (flip '())
()
> (flip '(a))
(a)
> (flip '(a b))
(b a)
> (flip '(a b c d))
(b a d c)
> (flip '(a b c d e))
(b a d c e) 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Define a recursive function flip in scheme which accepts
Reference No:- TGS099771

Expected delivery within 24 Hours