us
plurid-data-structures-typescript
us | plurid-data-structures-typescript | |
---|---|---|
2 | 1 | |
55 | 1 | |
- | - | |
1.5 | 3.1 | |
4 months ago | about 1 year ago | |
Go | TypeScript | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
us
-
Ask HN: What are some 'cool' but obscure data structures you know about?
It might be easier to think about it as a stack, rather than a tree. Each element of the stack represents a subtree -- a perfect binary tree. If you ever have two subtrees of height k, you merge them together into one subtree of height k+1. Your stack might already have another subtree of height k+1; if so, you repeat the process, until there's at most one subtree of each height.
This process is isomorphic to binary addition. Worked example: let's start with a single leaf, i.e. a subtree of height 0. Then we "add" another leaf; since we now have a pair of two equally-sized leaves, we merge them into one subtree of height 1. Then we add a third leaf; now this one doesn't have a sibling to merge with, so we just keep it. Now our "stack" contains two subtrees: one of height 1, and one of height 0.
Now the isomorphism: we start with the binary integer 1, i.e. a single bit at index 0. We add another 1 to it, and the 1s "merge" into a single 1 bit at index 1. Then we add another 1, resulting in two 1 bits at different indices: 11. If we add one more bit, we'll get 100; likewise, if we add another leaf to our BNT, we'll get a single subtree of height 2. Thus, the binary representation of the number of leaves "encodes" the structure of the BNT.
This isomorphism allows you to do some neat tricks, like calculating the size of a Merkle proof in 3 asm instructions. There's some code here if that helps: https://github.com/lukechampine/us/blob/master/merkle/stack....
You could also check out section 5.1 of the BLAKE3 paper: https://github.com/BLAKE3-team/BLAKE3-specs/blob/master/blak...
-
My proposal to the Foundation: add first-class S3 provider support
This isn't what I'm asking for - I don't care if it's baked into us, exists as a backend for minio, uses PseudoKV https://github.com/lukechampine/us/issues/67, or whatever the case may be. I see no value in sending any third party my private data in an unencrypted form (uploading to your server, even if over HTTPS, you got my data).
plurid-data-structures-typescript
-
Ask HN: What are some 'cool' but obscure data structures you know about?
Somewhat along these lines, I have formed a concept forcedly called "differentially composable string", or "deposed string", or more precise "poor man's git".
The intended use case is to obtain a compact representation of all the historic text entered into an input field (notes, comments, maybe long-form): all the stages of the text, where a stage is a tuple [add/remove, start_index, text/end_index]. Once you get the stages from the deposed string as JSON, you could transform them however you want then load them into a new deposed string.
You can read more on GitHub: https://github.com/plurid/plurid-data-structures-typescript#... or play around on my note-taking app implementing deposed strings and more: https://denote.plurid.com
What are some alternatives?
lnd - Lightning Network Daemon ⚡️
sdsl-lite - Succinct Data Structure Library 2.0
ego - EGraphs in OCaml
RVS_Generic_Swift_Toolbox - A Collection Of Various Swift Tools, Like Extensions and Utilities
swift - the multiparty transport protocol (aka "TCP with swarming" or "BitTorrent at the transport layer")
multiversion-concurrency-control - Implementation of multiversion concurrency control, Raft, Left Right concurrency Hashmaps and a multi consumer multi producer Ringbuffer, concurrent and parallel load-balanced loops, parallel actors implementation in Main.java, Actor2.java and a parallel interpreter
pvfmm - A parallel kernel-independent FMM library for particle and volume potentials
PSI - Private Set Intersection Cardinality protocol based on ECDH and Bloom Filters
gring - Golang circular linked list with array backend
t-digest - A new data structure for accurate on-line accumulation of rank-based statistics such as quantiles and trimmed means
ctrie-java - Java implementation of a concurrent trie
AspNetCoreDiagnosticScenarios - This repository has examples of broken patterns in ASP.NET Core applications