flat_tree
Version, currently 0.1.13 versions
- 0.1.2latestApr 8, 2021
- 0.1.1not indexedOct 25, 2023
- 0.1.0not indexedOct 25, 2023
github.com/dukenguyenxyz/flat_tree
Map a binary tree to a vector
Nothing has been indexed for 0.1.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
flat_tree:
github: dukenguyenxyz/flat_tree
version: ~> 0.1.1Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.1. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
flat_tree
Map a binary tree to a vector. Port of mafintosh/flat-tree
Installation
-
Add the dependency to your
shard.yml:dependencies: flat_tree: github: dukeraphaelng/flat_tree -
Run
shards install
Usage
You can represent a binary tree in a simple flat list using the following structure
3
1 5
0 2 4 6 ...
This module exposes a series of functions to help you build and maintain this data structure
require "flat_tree"
list = [] of String
i = FlatTree.index(0_u64, 0_u64) # get array index for depth: 0, offset: 0
j = FlatTree.index(1_u64, 0_u64) # get array index for depth: 1, offset: 0
# use these indexes to store some data
list[i] = 'a'
list[j] = 'b'
list[FlatTree.parent(i)] = 'parent of a and b'
Contributing
- Fork it (https://github.com/dukeraphaelng/flat_tree/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature')
- This repository follows Conventional Commits
- Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Duke Nguyen - creator and maintainer
License
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.1- Tagged
- Oct 25, 2023
- Commit
51c1c75c56c6- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dukenguyenxyz/flat_tree
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 3