Data Structure is some thing which is base of any programming field whether it is Data Science , General Algorithm design or game development etc .So we can not ignore data structures in any language . Inorder to understand 5 ways to make Data Structure Stronger in Python . We need to start from an interesting overview . So Lets take very high level overview of Data Structure in python–
1.General Data Structure-
These data structures and quite generic and core concepts remain unchanged across all programming language . For example – LinkList , Tree , Array etc . The implementation will be different and completely syntax oriented across all the language .
2.Python Specific Data Structure-
There are some data structure which are specifically design for Python programming . Like – Dictionary , Sets , List ,tuple etc . You need to have strong hands on these . Because most of the time we use these data structures over the general data structures . These are optimized and quite faster .
Tips for making Data Structure Stronger in Python –
Today we will discuss the strategies for improving yours understandings in Data Structures with Python –
- First take an overview of Python specific data structures . See all possible associated functions like insertion, deletion , iterations etc . Do not ignore their documentation because in so many cases we start writing custom code using loop and conditional statements . but there may be some implicit function which may help us and save tons of time .
- Know about the complexity of all implicit action perform by the functions . For example sorting , In Python use use sort() which performs the complete sorting over the list in n(logn) worst case complexity . This will help you to choose the best data structure as per your requirement scenario . Never apply the any data structure and operation associated with it blindly .
- Once you done with Python specific data structure and start moving towards the general data structure , You should choose linear data structure (Array , LinkList , queues ,stack etc )first . They are quite easier to understand and implement with respect to Non Linear Data Structures ( Trees , Heaps Graph etc )
- Start hands on coding on General data structure . In this step learn – creation , insertion , traversal , removal in all the data structure .
- Practice the questions on competitive programming platform like Hackerank etc .
General Data Structure Vs Python Specific Data Structure-
Before starting this section , I have to ask you some thing that ,”Do you really think every language has its own data structure ?” . This question is pretty straight but I found so many people are still confuse . Do you know why ? See the reason is – they think that most of the data structure like trees , link list which we read in academics are C and C++ specific . Because in the Industries ( Majority ) developer use hash map , linked hash map in java , In python programming dictionary , list etc are mainly preferable . By the way these data structure like trees , LinkList are quite generic , we mostly use their advance and specific form like List in python etc .Because Python data structures are highly optimized and need very less time to implement . Hence they get the priority from custom data structures .
Do not forget to write your views on the article – 5 ways to make Data Structure Stronger in Python .
Thanks
Data Science Learner Team
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.