User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

reversing_an_array [2015/02/02 23:02]
will created
reversing_an_array [2015/02/03 09:13] (current)
will Recursive alg. always O(n).
Line 7: Line 7:
 The javascript built-in function ''​a.reverse()''​ returns a new array and does not perform an in-place reverse. The javascript built-in function ''​a.reverse()''​ returns a new array and does not perform an in-place reverse.
  
-The recursive version of this algorithm is a useful study of recursion, but would not be used due to its worse performance. This algorithm has time complexity $O(n)$ and space complexity $O(n)$ ​for non tail-call optimised languages.+The recursive version of this algorithm is a useful study of recursion, but would not be used due to its worse performance. This algorithm has time complexity $O(n)$ and space complexity $O(n)$.
  
 [algorithm reverse an array - recursive] [algorithm reverse an array - recursive]
reversing_an_array.txt ยท Last modified: 2015/02/03 09:13 by will