0 reply content:
- Why is there almost infinite space in the list of Python? Why is there a tuple with a fixed length and cannot be modified instead of a list?
- Does the insert and append operations of list take the same time?
- What is the problem with Python dict? Why can I use string numbers and other things for indexing? How did you search? What is the difference between finding an element in dict and finding an element in list?
- In what scenarios should you use Python's built-in list, dict, set,... data structure?
- Xiao mingjia opened the commissary and thought that Xiao Ming was a programmer. He needed to use Python to write a program to find the change, input any integer, and output the minimum number of sheets needed to find the change, how Should James write?
I have forgotten where I have heard this sentence. I personally think it is very suitable to answer your question:
"Although most of the popular advanced languages have their own support for common data structures, and most of you cannot provide better implementations, the motivation for continuing to learn the data structure is:
It allows you to learn to select a correct and appropriate data structure to solve a specific problem."
Especially in languages like Python, the data structures of built-in: list, dict, set... seem omnipotent (indeed, sometimes it is omnipotent ). However, if you understand the specific implementation behind them, you will find that the seemingly perfect data structure is not necessarily a proper choice.
For example, if the memory space is "word" like gold, the main purpose is sequential access, and there is no need for dynamic expansion at all, the list is not suitable for the traditional array, for specific reasons, let's take a look at the implementation principle of list..
Recommend a book:
Data Structures and Algorithms Using PythonCan be downloaded to a pdf file. In addition to the Python implementation of several common data structure stacks, queues, and binary trees, it is particularly recommended that, the implementation of several Python built-in data structures is also analyzed in detail. I believe it will help. The only drawback is that only the English version is available. Read it with patience and you will have a feeling of openness.
++ ++
Supplement:
The sample code at the end of this book is a bit confusing, mixed with Python 2.x and Python 3.x.
Attach a download link:
Data Structures and Algorithms Using pythonures _ free high-speed download
Python programmers learn the roadmap python + data structures and algorithms + linux + software engineering + web development + git Version Control + communication skills and so on. Of course not. Are you still asking this obvious question? Python is a language.
Data structures and algorithms teach you how to use various languages efficiently.
To use Python efficiently, you need to learn algorithms and data structures.