title: What is the complexity difference between the two various ways of initialization of Array in Ruby
body: <p>What is the complexity difference between the two various ways of initialization of Array in Ruby?</p>
  
  <p>I need to initialize my new Array to 0.</p>
  
  <p>I could do either of the ways:</p>
  
  <pre><code>newArray = Array.new(a,0)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>newArray = Array.new(a){|i| i*0}
  </code></pre>
  
  <p>I need to know the difference between the time complexity if any?</p>