Question: Write the following in scheme: split* takes a list, that can contain sublists, and returns a list containing two lists. The first list should contain

Write the following in scheme:

split* takes a list, that can contain sublists, and returns a list containing two lists. The first list should contain the 1st, 3rd, 5th, ... elements, and the second list should contain the 2nd, 4th, 6th, ... elements. However, if any of these elements are also lists, these elements should be split as well.

> (split* '(a b ((c d) e f g) (((h i) j k l (m n o p))))) ((a ((((c) (d)) f) (e g))) (b ((((((h) (i)) k ((m o) (n p))) (j l))) ()))) 

> (split* '(a b (c d e) f g)) --> ((a ((c e) (d) g) (b f))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!