在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:bfaure/Python_Data_Structures开源软件地址:https://github.com/bfaure/Python_Data_Structures开源编程语言:Python 100.0%开源软件介绍:Python_Data_StructuresCode from Youtube Tutorial Series. Each lesson begins by introducing the idea behind the data structure then, after explaining some basic concepts, moves over to coding the actual Python class. All the code in this repository is implemented in Python 2, for Python 3 see 'Python3_Data_Structures'. AVL Tree (AVL_Tree)The AVL Tree is an improvement upon the traditional Binary Search Tree (BST) that implements an auto-balancing feature, with the hopes to keep tree operations closer to O(logn) rather than O(n). After insertions and deletions that cause the tree to become unbalanced, special functions are called to manage the situation by rebalancing any nodes they find to be unbalanced. If you don't have experience with traditional BSTs you should start with the tutorial covering those. Binary Search Tree Validator (BST_Validator)The BST validator is a function whose purpose is to check whether the input BST adheres to the rules of a binary search tree, namely that for every node, the subtree rooted at its left child contains only smaller values, and the subtree rooted at its right child contains only larger values. The code for this lesson is simple once explained but is not that easy to come up with from scratch. Binary_Search_TreeThe most popular data structure, the binary search tree is an intuitive way of storing sortable data that provides faster-than-linear search capabilities. Values in a BST are wrapped in a 'node' class used to link the tree together. Given a certain node 'n' with value 'v', all nodes to the right of 'n' contain values larger than 'v', and all nodes to the left contain values smaller than 'v'. Linked_ListThe linked list is a useful data structure providing similar functionality to an array, but in a dynamic package. Albeit, not as useful in Python as in statically typed languages, the linked list is still an interesting project to undertake. Similar to BST, values in a linked list are wrapped in an instance of a 'node' class containing a pointer, allowing the whole list to be linked together by distributed references. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论