title: Scheme Inverse List Function
body: <p>I defined a function called zip which took two lists as parameters and returned a list of pairs. </p>
  
  <pre><code>(define (zip list1 list2)
  (if (null? list1)
    '()
     (cons (list (cons (car list1) (car list2)))
              (zip (cdr list1) (cdr list2)))))
  
  (zip (list 1 3 5) (list 2 4 6))
  &gt; (((1 . 2)) ((3 . 4)) ((5 . 6)))
  </code></pre>
  
  <p>Now I'm basically having trouble writing the inverse function of this. This is what I have so far. This function needs to output a list of two lists. I only attempted at making the first of the two lists to make it easier for myself but the output is not what I want.</p>
  
  <pre><code>(define (unzip u-list)
    (if (null? u-list)
        '()
         (list (car (car (car u-list))) (unzip(cdr u-list)))))
  
  
  (unzip (zip (list 1 3 5) (list 2 4 6)))
  &gt; (1 (3 (5 ())))
  </code></pre>
  
  <p>Any help would be appreciated...</p>