Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/infinitifall/natlibc
A tiny standalone library for trees in C. Zero dependency, extensively documented, < 1000 SLOC.
https://github.com/infinitifall/natlibc
binary-tree binary-trees data-structures n-ary-tree tree tree-structure trees
Last synced: 4 days ago
JSON representation
A tiny standalone library for trees in C. Zero dependency, extensively documented, < 1000 SLOC.
- Host: GitHub
- URL: https://github.com/infinitifall/natlibc
- Owner: Infinitifall
- License: mit
- Created: 2023-12-24T07:03:15.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-01T08:25:16.000Z (11 months ago)
- Last Synced: 2024-01-30T02:05:02.951Z (10 months ago)
- Topics: binary-tree, binary-trees, data-structures, n-ary-tree, tree, tree-structure, trees
- Language: C
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NATlibc (n-ary trees)
A tiny standalone library for trees in C.
- Zero-dependency
- Extensively documented
- < 1000 SLOC|Progress |Module |Header file |
|-----------|-----------------------|-------------------------------|
|✅ |Records | [record.h](./record.h) |
|🚧 |Binary trees | [bt.h](./bt/bt.h) |
|🚧 |Binary search trees | [bst.h](./bt/bst/bst.h) |
|❌ |AVL trees | [avl.h](./bt/bst/avl/avl.h) |
|❌ |N-ary trees | - |
|❌ |Common binary tree algorithms | - |## Install
```bash
# clone repo
git clone https://github.com/Infinitifall/n-ary-trees
cd n-ary-trees# make
cd build
make
```## Use
Run the code in [example.c](./example.c), which defines a small tree and prints it
```bash
# run example
cd build
./example
``````
Note: node 0 at 0x55bb67ced4b0 has no parents, setting as root node.| | |______3,33
| |______2,7
|______1,5
0,2
| |______5,8
|______4,19
| | |______7,11
| |______6,9
| | |______8,143: 33
2: 7
1: 5
0: 2
5: 8
4: 19
7: 11
6: 9
8: 14
```