{ "info": { "author": "Yi Zhou", "author_email": "601746479@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python :: 3 :: Only" ], "description": "# pytrees\n![](https://img.shields.io/badge/LICENSE-MIT-green.svg)\n![](https://img.shields.io/badge/python-python3-color.svg)\n\nA collection of python3 implementations of trees. Including AVL Tree, Interval Tree and More.\n\n## Classes\n\n### AVL Tree\n\nAVL Tree. \nBalanced Binary Search Tree. Gurantee for balance.\n\nAPI:\n\n- insert(self, val)\n- delete(self, key)\n- search(self, key)\n- getDepth(self)\n- preOrder(self)\n- inOrder(self)\n- postOrder(self)\n- countNodes(self)\n- buildFromList(cls, l)\n\n### Interval Tree\n\nAugmented data structure for checking overlaps of intervals. Gurantee for balance.\n\nAPI:\n\n- queryOverlap(self, val)\n- queryAllOverlaps(self, val)\n- insert(self, val)\n- delete(self, key)\n- search(self, key)\n- getDepth(self)\n- preOrder(self)\n- inOrder(self)\n- postOrder(self)\n- countNodes(self)\n- buildFromList(cls, l)\n\n### Binary Search Tree\n\nSimple implementation of Binary Search Tree. No gurantee for balance.\n\n\nAPI:\n\n- insert(self, val)\n- delete(self, key)\n- search(self, key)\n- getDepth(self)\n- preOrder(self)\n- inOrder(self)\n- postOrder(self)\n- countNodes(self)\n- buildFromList(cls, l)\n\n### Trie (Prefix-Tree)\n\nPrefix-tree. Useful for text search.\n\nAPI: \n\n- insert(self, word)\n- search(self, word)\n- startsWith(self, prefix)\n- findAllWordsStartsWith(self, prefix)\n- buildFromList(cls, l)\n\n### Binary Index Tree\n\nA Fenwick tree or Binary Indexed Tree is a data structure that can efficiently update elements and calculate prefix sums in a table of numbers.\n\nAPI: \n\n- update(self,i,k) --> update value k to index i\n- prefixSum(self,i) --> sum up [index 0, index 1, ..., index i]\n- preview(self) \n- getSize(self)\n- buildFromList(cls, l)\n\nTime Complexity: update & prefixSum, O(logN)\n\nSpace Complexity: O(N)\n\n## Convention: \n\n- \"key\" and \"val\" are almost the same in this implementation. use term \"key\" for search and delete a particular node. use term \"val\" for other cases", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/cool-pot/pytrees/archive/v0.0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cool-pot/pytrees", "keywords": "", "license": "MIT", "maintainer": "Yi Zhou", "maintainer_email": "601746479@qq.com", "name": "pytrees", "package_url": "https://pypi.org/project/pytrees/", "platform": "Windows", "project_url": "https://pypi.org/project/pytrees/", "project_urls": { "Download": "https://github.com/cool-pot/pytrees/archive/v0.0.1.tar.gz", "Homepage": "https://github.com/cool-pot/pytrees" }, "release_url": "https://pypi.org/project/pytrees/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "AVL Tree, Interval Tree, Trie and More. All kinds of Trees implemented in python3.", "version": "0.0.1" }, "last_serial": 3883945, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2aa2785d9a62d6c8a8a37303cbdd13cc", "sha256": "0f33150c64a51e9f2b1fe5130e81105651ed6acf76104b2168d14e15dfc7e4d1" }, "downloads": -1, "filename": "pytrees-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2aa2785d9a62d6c8a8a37303cbdd13cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23857, "upload_time": "2018-05-21T15:40:44", "url": "https://files.pythonhosted.org/packages/ef/02/01e905aff44ab3331cc985718682b8798a321d9bf9fc7d56eae9e3df2367/pytrees-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2aa2785d9a62d6c8a8a37303cbdd13cc", "sha256": "0f33150c64a51e9f2b1fe5130e81105651ed6acf76104b2168d14e15dfc7e4d1" }, "downloads": -1, "filename": "pytrees-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2aa2785d9a62d6c8a8a37303cbdd13cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23857, "upload_time": "2018-05-21T15:40:44", "url": "https://files.pythonhosted.org/packages/ef/02/01e905aff44ab3331cc985718682b8798a321d9bf9fc7d56eae9e3df2367/pytrees-0.0.1.tar.gz" } ] }