title: Algorithm with O(n log n) time and O(1) space complexity vs O(n) time and O(n) space complexity
body: <p>I am curious to know which algorithm is better :</p>
  
  <ul>
  <li>Algorithm with O(n log n) time and O(1) space complexity</li>
  <li>Algorithm with O(n) time and O(n) space complexity </li>
  </ul>
  
  <p>Most of the algorithm which are solved in O(n long n) time and constant space can be solved in O(n) time by paying penalty in terms of space. Which algorithm is better ?
  How do I decide between these two parameters ?</p>
  
  <p>Example : Array Pair Sum </p>
  
  <ol>
  <li>Can be solved in O(n logn) time by sorting </li>
  <li>Can be solved using hash maps in O(n) time but with O(n) space </li>
  </ol>