# pytrees  
A collection of python3 implementations of trees. Including AVL Tree, Interval Tree and More.
## Classes
### AVL Tree
AVL Tree. Balanced Binary Search Tree. Gurantee for balance.
API:
insert(self, val)
delete(self, key)
search(self, key)
getDepth(self)
preOrder(self)
inOrder(self)
postOrder(self)
countNodes(self)
buildFromList(cls, l)
### Interval Tree
Augmented data structure for checking overlaps of intervals. Gurantee for balance.
API:
queryOverlap(self, val)
queryAllOverlaps(self, val)
insert(self, val)
delete(self, key)
search(self, key)
getDepth(self)
preOrder(self)
inOrder(self)
postOrder(self)
countNodes(self)
buildFromList(cls, l)
### Binary Search Tree
Simple implementation of Binary Search Tree. No gurantee for balance.
API:
insert(self, val)
delete(self, key)
search(self, key)
getDepth(self)
preOrder(self)
inOrder(self)
postOrder(self)
countNodes(self)
buildFromList(cls, l)
### Trie (Prefix-Tree)
Prefix-tree. Useful for text search.
API:
insert(self, word)
search(self, word)
startsWith(self, prefix)
findAllWordsStartsWith(self, prefix)
buildFromList(cls, l)
### Binary Index Tree
A Fenwick tree or Binary Indexed Tree is a data structure that can efficiently update elements and calculate prefix sums in a table of numbers.
API:
update(self,i,k) –> update value k to index i
prefixSum(self,i) –> sum up [index 0, index 1, …, index i]
preview(self)
getSize(self)
buildFromList(cls, l)
Time Complexity: update & prefixSum, O(logN)
Space Complexity: O(N)
## Convention:
“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
Metadata
Release files for pytrees 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytrees-0.0.1.tar.gz | 23.9 kB | Without provenance | Details for pytrees-0.0.1.tar.gz |
Release files / pytrees-0.0.1.tar.gz
| Download URL | pytrees-0.0.1.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f33150c64a51e9f2b1fe5130e81105651ed6acf76104b2168d14e15dfc7e4d1
|
|
BLAKE2b-256 checksum How to use checksums |
ef0201e905aff44ab3331cc985718682b8798a321d9bf9fc7d56eae9e3df2367
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pytrees 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.