 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Take,
for example, the ADTs for the ordered list
|
|
|
|
operation
RETRIEVE;
|
|
|
|
– |
remember,
it retrieves a value of the item in the Nth
|
|
|
position
in the ordered list.
|
|
|
|
– |
In
the array based implementation, the Nth item can be
|
|
|
accessed
directly (it is stored in position N). This
|
|
|
|
access
is INDEPENDENT OF N!
|
|
|
|
– |
Therefore,
RETRIEVE takes the same amount of time
|
|
|
|
to
access either the 100th item or the first item in the
|
|
|
|
list.
Thus, an array based implementation of
|
|
|
|
RETRIEVE
is O(1).
|
|