algorithms
rb_heap
algorithms | rb_heap | |
---|---|---|
3 | 1 | |
2,651 | 18 | |
- | - | |
5.6 | - | |
3 months ago | about 3 years ago | |
Ruby | Ruby | |
MIT License | MIT License |
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.
algorithms
- Ruby Heaps Inspired by Python
- Using Ruby for technical interviews at FAANG companies?
-
Experiments in concurrency 3: Event loops
Rather than implementing mine, I'll be using the priority queue from this library. We'll replace our @timers array with a priority queue instead. Here's how our queue will work:
rb_heap
-
Ruby Heaps Inspired by Python
Defining a new class is probably the most Ruby way to do it. There are two implementations that define a new class: rb_heap[1] and algorithms[2]. However, algorithms[2] use a Fibonacci heap, which should technically have better time complexity but is slower in practice, and the library pulls in a lot of unnecessary stuff. rb_heap is good, although I think using a symbol to specify if it's a max/min heap is a little strange.
There is something satisfying about using an array like Python. It's very straightforward and doesn't require you to convert back and forth between a queue and a array.
That's an interesting idea to use Queue. I do need random access to implement the binary queue, so I'm not sure if Queue would work.
1. https://github.com/florian/rb_heap
What are some alternatives?
jaro_winkler - Ruby & C implementation of Jaro-Winkler distance algorithm which supports UTF-8 string.
clipboard-rails - clipboard.js javascript library integration for your Rails 4 and Rails 5 applications
smarter_csv - Ruby Gem for smarter importing of CSV Files as Array(s) of Hashes, with optional features for processing large files in parallel, embedded comments, unusual field- and record-separators, flexible mapping of CSV-headers to Hash-keys
Time Math - Small library for operations with time steps (like "next day", "floor to hour" and so on)
Piperator - Composable pipelines for Enumerators.
Related - Pure Ruby relational algebra
counter_culture - Turbo-charged counter caches for your Rails app.
Fusuma - Multitouch gestures with libinput driver on Linux
autocannon - fast HTTP/1.1 benchmarking tool written in Node.js
pairing_heap - Performant priority queue in pure Ruby with support for changing priority using pairing heap data structure
SciRuby - Tools for scientific computation in Ruby
algorithms - algorithms playground for common questions