title: Should I implement PriorityQueue (Heap) on List in OCaml?
body: <p>I understand that <code>priorityQueue</code> is perfect on <code>Array</code> as its nature is in place.</p>
  
  <p><strong>Should I implement PriorityQueue (Heap) on List in OCaml?</strong> </p>
  
  <p>If I do it on <code>List</code>, then I have to remove the <code>in-place</code> thing and think a way to <code>every time</code> create a new list in every step. So I am wondering whether it is worth it, or not.</p>
  
  <hr>
  
  <p>Actually, I have a more deeper thought on this.</p>
  
  <p>So, many <code>fundamental</code> algorithms / datastructures were invented from <code>in-place</code> (I use <code>invented</code> because I understand many in-place can be transformed to be <code>not-in-place</code>). </p>
  
  <p>However, <code>FL</code> does not recommend <code>mutable</code> things. One of my further questions is <strong>how do I choose between <code>in-place / mutable</code> and <code>immutable</code>?</strong> or <strong>in OCaml, when should I choose between <code>list</code> and <code>array</code>?</strong></p>
  
  <hr>
  
  <p>For example, in the above <code>priorityqueue</code> case, if I was asked to write a <code>priorityqueue</code> in OCaml, should I prefer <code>array</code> as it is more nature and easier, or I should choose list for the sake of being immutable?</p>