If I am given three functions:
1) empty – returns whether a passed list is empty
2) split – splits one list into two equal sized lists
3) concat – concatenates two lists into one
Using only these three functions, how can I reverse a list?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Split list in two, recursively reverse sublists, and merge them backwards.