title: Binary trees and quicksort?
body: <p>I have a homework assignment that reads as follows (don't flame/worry, I am <em>not</em> asking you to do my homework):</p>
  <blockquote>
  <p>Write a program that sorts a set of numbers by using the Quick Sort method using a binary search
  tree. The recommended implementation is to use a recursive algorithm.</p>
  </blockquote>
  <p>What does this mean? Here are my interpretations thus far, and as I explain below, I think both are flawed:</p>
  <blockquote>
  <p>A. Get an array of numbers (integers, or whatever) from the user. Quicksort them with the normal quicksort algorithm on arrays. Then put stuff into a binary search tree, make the middle element of the array the root, et cetera, done.</p>
  <p>B. Get numbers from the user, put them directly one by one into the tree, using standard properties of binary search trees. Tree is 'sorted', all is well--done.</p>
  </blockquote>
  <p>Here's why I'm confused. Option 'A' does everything the assignment asks for, except it doesn't really use the binary tree so much as it throws it last minute in the end since it's a homework assignment on binary trees. This makes me think the intended exercise couldn't have been 'A', since the main topic's not quicksort, but binary trees.</p>
  <p>But option 'B' isn't much better--it doesn't use quicksort at all! So, I'm confused.</p>
  <p>Here are my questions:</p>
  <ol>
  <li><p>if the interpretation is option 'A', just say so, I have no questions, thank you for your time, goodbye.</p>
  </li>
  <li><p>if the interpretation is option 'B', why is the sorting method used for inserting values in binary trees the same as quicksort? they don't <em>seem</em> inherently similar other than the fact that they both (in the forms I've learned so far) use the recursion divide-and-conquer strategy and divide their input in two.</p>
  </li>
  <li><p>if the interpretation is something else...what am I supposed to do?</p>
  </li>
  </ol>