Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge. Learn more →
Top 18 C Algorithm Projects
🎁 A glib-like multi-platform c library
A standalone and lightweight C libraryProject mention: Factor is faster than Zig | news.ycombinator.com | 2023-11-10
In my example the table stores the hash codes themselves instead of the keys (because the hash function is invertible)
Oh, I see, right. If determining the home bucket is trivial, then the back-shifting method is great. The issue is just that it’s not as much of a general-purpose solution as it may initially seem.
“With a different algorithm (Robin Hood or bidirectional linear probing), the load factor can be kept well over 90% with good performance, as the benchmarks in the same repo demonstrate.”
I’ve seen the 90% claim made several times in literature on Robin Hood hash tables. In my experience, the claim is a bit exaggerated, although I suppose it depends on what our idea of “good performance” is. See these benchmarks, which again go up to a maximum load factor of 0.95 (Although boost and Absl forcibly grow/rehash at 0.85-0.9):
Tsl, Martinus, and CC are all Robin Hood tables (https://github.com/Tessil/robin-map, https://github.com/martinus/robin-hood-hashing, and https://github.com/JacksonAllan/CC, respectively). Absl and Boost are the well-known SIMD-based hash tables. Khash (https://github.com/attractivechaos/klib/blob/master/khash.h) is, I think, an ordinary open-addressing table using quadratic probing. Fastmap is a new, yet-to-be-published design that is fundamentally similar to bytell (https://www.youtube.com/watch?v=M2fKMP47slQ) but also incorporates some aspects of the aforementioned SIMD maps (it caches a 4-bit fragment of the hash code to avoid most key comparisons).
As you can see, all the Robin Hood maps spike upwards dramatically as the load factor gets high, becoming as much as 5-6 times slower at 0.95 vs 0.5 in one of the benchmarks (uint64_t key, 256-bit struct value: Total time to erase 1000 existing elements with N elements in map). Only the SIMD maps (with Boost being the better performer) and Fastmap appear mostly immune to load factor in all benchmarks, although the SIMD maps do - I believe - use tombstones for deletion.
I’ve only read briefly about bi-directional linear probing – never experimented with it.
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
Common libraries and data structures for C.Project mention: A simple hash table in C | news.ycombinator.com | 2023-06-13
Quadsort is a branchless stable adaptive mergesort faster than quicksort.Project mention: 10~17x faster than what? A performance analysis of Intel x86-SIMD-sort (AVX-512) | news.ycombinator.com | 2023-06-10
As you can see, quadsort 220.127.116.11 used 2 instead of 4 writes in the bi-directional parity merges. This was in June 2021, and would have compiled as branchless with clang, but as branched with gcc.
When I added a compile time check to use ternary operations for clang I was not adapting your work. I was well aware that clang compiled ternary operations as branchless, but I wasn't aware that rust did as well. I added the compile time check to use ternary operations for a fair performance comparison against glidesort.
As for ipnsort's small sort, it is very similar to quadsort's small sort, which uses stable sorting networks, instead of unstable sorting networks. From my perspective it's not exactly novel. I didn't go for unstable sorting networks in crumsort to increase code reuse, and to not reduce adaptivity.
Fast, header-only polygon triangulation
Blitsort is an in-place stable adaptive rotate mergesort / quicksort.Project mention: Glidesort, a new stable sort in Rust up to ~4x faster for random data | /r/programming | 2023-02-03
A fast alternative to the modulo reduction
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
SHA-2 algorithm implementations (by amosnier)Project mention: COTP Generator | /r/C_Programming | 2023-06-23
the lib i used as base its : https://github.com/amosnier/sha-2
Heavily optimized zlib compression algorithm
:herb: A library of "connected" data structures
Robin Hood Sort, for uniform dataProject mention: Need a Quick Favor: Help a Student with a Simple Click! | /r/github | 2023-11-19
I’m in the midst of a class project that requires a GitHub repository with over 100 stars. It’s one of the key criteria I need to meet, and I’m almost there. The repo I’ve been contributing to is https://github.com/mlochbaum/rhsort , which aligns perfectly with my project's needs—except it’s a bit short on stars.
New Shuffle algorithm with ultra low overhead and no annoying repetition.Project mention: New Shuffle algorithm with ultra low overhead and no annoying repetition | news.ycombinator.com | 2023-02-21
C Language Template Library C语言 模板库
Advanced Data Structures and Algorithms in C ( DSA )
C Library of Aho-Corasick Algorithm based on Coordinate Hash TrieProject mention: A Trie Variant Balancing between Time, Space, and Simplicity; And a C Implementation of the Aho-Corasick Algorithm Based on It | /r/compsci | 2023-02-28
Repo of the A.-C algorithm implementation: https://github.com/dongyx/libaca
A block hashing algorithm with implementations in C, Rust, Go, Nim, Python and JSProject mention: How do crypto functions deal with the issue of character size? (e.g. Unicode) | /r/cryptography | 2023-06-18
Hey guys. If you remember me from several months ago, with this object de art, I am here with a less cringy question than that of 'I made a hash function!!!111'. I apologize if this question is basic btw. My question is, how do crypto functions, of any kind, deal with character size? For example in C, wchar_t is either 2 or 4 bytes. So, if the implementation goes through the stream like stream++ it will be stepping word-wise not byte-wise. And then if another machine, using a different implementation, reads the stream byte-wise and not word-wise, then it won't get the same message right?
Arduino Library for Sensirion's Gas Index Algorithm, providing a VOC and NOx Index output signal calculated from the SGP40/41 raw signalsProject mention: Hey I’m using arduino to detect voc levels | /r/arduino | 2022-12-23
Finally you can use Sensirons algorithm to calculate Sensirons VOC index.
HSL to RGB and RGB to HSLProject mention: Can I keep the gradient when replace colors? (see comment) | /r/pygame | 2022-12-29
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
C Algorithm related posts
Need a Quick Favor: Help a Student with a Simple Click!
1 project | /r/github | 19 Nov 2023
How do crypto functions deal with the issue of character size? (e.g. Unicode)
1 project | /r/cryptography | 18 Jun 2023
shibajs1.h: Quick and Dirty JSON Parsing (not an advertisement!) --- Seeking comments, good ones. Thanks
2 projects | /r/C_Programming | 18 Jun 2023
GitHub - frymimori/c-sorter: Create ascending and descending ordered arrays using C with a fast and unique hybrid sorting algorithm.
4 projects | /r/C_Programming | 11 Jun 2023
Doubt regarding counting sort
2 projects | /r/algorithms | 12 Jun 2023
Encoding Huffman freq table?
1 project | /r/compsci | 18 May 2023
[Offer] I am a systems, network, and SciComp programmer, I am looking for small, short gigs to fund my libre projects. I have a good portfolio, and I have adequate grasp of theory. My prices begin at $5 and end at $60 for small, one-time gigs. C, x86-64|Aarch64 Assembly, Go, Python, Shell Scripting
2 projects | /r/slavelabour | 6 May 2023
A note from our sponsor - InfluxDB
www.influxdata.com | 9 Dec 2023
What are some of the best open-source Algorithm projects in C? This list will help you: