In the data structure that piece, search ordered find/two find/hash find, while sort have bubble sort/select sort/Insert sort/merge sort/quick sort. If you encounter data volumes and arrays in different ways, you may need to use a hybrid algorithm based on time complexity considerations. If you write in C, it is a headache and a high threshold of the process, Python is a very simple way to make such algorithms available to everyone.
Sort, Python uses a sort function, which uses an adaptable, stable, natural merge algorithm called Timsort. While searching, using the dictionary, the time complexity can be reduced to O (1), and the way the dictionary is implemented, is the use of the hash function, and hash lookup, then use the open addressing method.
Give two examples of Python simplicity
1. Sorting
In [1]: a_list=[22,33,11,9,77,22]
In [2]: A_list.sort ()
In [3]: a_listout[3]: [9, 11, 22, 22, 33, 77]
2. Find
In [5]: dict={'key1':'hh','key2' :key3':'II'}in [6]: dict[ ' Key3 ' ]out['II'
There may be nothing to see here, because it's just a simple usage. When you can implement a series of data structures and write the corresponding hybrid algorithms yourself, you can feel how much python is doing behind the times.
A ramble on search/Sort in Python