The running times calculated for the various methods of the two sorted list implementations, SortedListAsArray and SortedListAsLinkedList, are summarized below in Table . With the exception of two methods, the running times of the two implementations are asymptotically identical.
sorted list implementation | |||
| SortedList- | SortedList- | |
method | AsArray | AsLinkedList | |
insert | O(n) | O(n) | |
isMember | O(n) | O(n) | |
find | O(n) | ||
withdraw | O(n) | O(n) | |
get | O(1) | O(n) | |
findPosition | O(n) | ||
Cursor.getDatum | O(1) | O(1) | |
Cursor.withdraw | O(n) | O(n) |
Neither the SortedListAsArray nor SortedListAsLinkedList implementations required any additional fields beyond those inherited from their respective base classes, OrderedListAsArray and OrderedListAsLinkedList. Consequently, the space requirements analysis of the sorted list implementations is identical to that of the ordered list implementations given in Section .