document updated 15 years ago, on May 14, 2009
Array
GetValue() | O(1) |
|
SetValue() | O(1) |
|
BinarySearch() | O(n log(n)) | behavior is undefined if not presorted
|
Reverse() | O(n) |
|
Resize() | O(n) | use ArrayList instead
|
Sort() | O(n log(n)) | quick sort
|
ArrayList
An array that grows as needed. When it expands, it allocates a new array, double in size, leaving room for further expansion.
GetValue() | O(1) |
|
SetValue() | O(1) |
|
Add() | O(1) | appends one to the end
|
RemoveAt() | O(n) | removing things from the middle requires an array copy
|
Insert() | O(n) | adding things from the middle requires an array copy
|
Sort() | O(n log(n)) | quick sort
|