You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Ordered Array/README.markdown
+2
Original file line number
Diff line number
Diff line change
@@ -110,4 +110,6 @@ The big difference with a regular binary search is that this doesn't return `nil
110
110
111
111
Note that using binary search doesn't change the worst-case running time complexity of `insert()`. The binary search itself takes only **O(log n)** time, but inserting a new object in the middle of an array still involves shifting all remaining elements in memory. So overall, the time complexity is still **O(n)**. But in practice this new version definitely is a lot faster, especially on large arrays.
112
112
113
+
A more complete and production ready [SortedArray](https://github.com/ole/SortedArray) is avalible from [Ole Begemann](https://github.com/ole). The [accompanying article](https://oleb.net/blog/2017/02/sorted-array/) explains to advantages and tradeoffs.
114
+
113
115
*Written for Swift Algorithm Club by Matthijs Hollemans*
0 commit comments