The linear form 04-2_Python

The order table Python

The Python list (list) and the tuple (component) using two types of implementation techniques sequence table
sequence table tuple is immutable, and therefore does not support any operations to change its internal state, and others, and the list of similar properties

listr basic implementation techniques

Python is a standard type with a variable number list one element linear form, may be added and deleted elements, and have been maintained in the various operating elements of the sequence (i.e., order-preserving)

Official implemented in Python, List sequence table is a kind of dynamic technology to achieve the separation . This is why (, i.e., insertion or tail list.insert (len (list), x )) with list.append (x) than the reason for the high efficiency of the element is inserted at the specified location.

Official implemented in Python, list implemented using the following strategy: an empty table when creating (or very small tables), the system assigns a storage area capable of accommodating 8 elements; in the insert operation (insert or append) If the storage area is full of elements on for a 4-fold larger storage area. But if this time table has been great (the current threshold of 50,000), the change in strategy, the method doubled. The introduction of such change strategy the way, is to avoid too much free memory location appears.

Guess you like

Origin www.cnblogs.com/nichengshishaonian/p/11576095.html