, , Python. .
:
Row Number Name Color City Fruit
---------- -------- -------- --------- -------
0 'guido', 'blue', 'austin', 'apple'
1 'sarah', 'orange', 'dallas', 'banana'
2 'barry', 'green', 'tuscon', 'orange'
3 'rachel', 'yellow', 'reno', 'pear'
4 'tim', 'red', 'portland', 'peach'
, ( ).
, ( ).
, . , O(log n) bisection:
Name Row Number
-------- ----------
'barry' 2
'guido' 0
'rachel' 3
'sarah' 1
'tim' 4
Python :
[2, 0, 3, 1, 4]
, ( ).
- . , O(1) :
Hash Name Row Number
---- -------- ----------
0 - -
1 'tim' 4
2 - -
3 'sarah' 1
4 - -
5 - -
6 'guido' 0
7 - -
8 'barry' 2
9 - -
10 'rachel' 3
11 - -
12 - -
13 - -
14 - -
15 - -
Python , None :
[None, 4, None, 1, None, None, 0, None, 2,
None, 3, None, None, None, None, None]
- , 16 ( 16) . .
, , , , "" .
, Python 3.6 / , . ( , ). . O(1). .
. , , Python . , - , .
, .