CS 340: Lab 13.5: Merge Sort in Clojure
Your task
Implement merge sort in Clojure. For example:
should yield the result
Hints and requirements:
- Assume that the input sequence will be a vector
- Use the
subvec
function to split the input - The
mergesort
function does not need to be tail recursive: however, your merge function should be tail recursive - The initial accumulator should be a vector, and the overall result should be a vector
- You are welcome to use the merge function from Lecture 14, but note that you will need to adapt it to use
conj
rather thancons