Yes you can do it. The main idea of mergesort is as follows:
- Divide the array into two (or more) parts.
- Sort each part independently.
- Use the merge step to combine the sorted fragments into one common sorted list.
, , , (2). , , , . mergesort (2), , , . (, mergesort , , ).
, quicksort mergesort . , , , , . , : ( ), . , . .. :
, . , , , .: -)