Yet another sort crate, porting Golang sort package to Rust.

Overview

IndexSort

IndexSort

Yet another sort crate (in place), porting Golang's standard sort package to Rust.

github Build codecov

docs.rs crates.io

license-apache license-mit

Installation

[dependencies]
indexsort = "0.1.0"

Acknowledgements

  • Porting Go's sort package, thanks for Go contributors.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
You might also like...
Yet another lightweight and easy to use HTTP(S) server

Raptor Web server Raptor is a HTTP server written in Rust with aims to use as little memory as possible and an easy configuration. It is built on top

Yet Another Texture Packer - a small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet

YATP (Yet Another Texture Packer) A small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet. Installation

🚀 Yet another repository management with auto-attaching profiles.

🚀 ghr Yet another repository management with auto-attaching profiles. 🔥 Motivation ghq is the most famous solution to resolve stress of our reposito

Yet another phigros chart player.

prpr - P hig R os P layer, written in R ust Usage To begin with, clone the repo: git clone https://github.com/Mivik/prpr.git && cd prpr For compactnes

YAL is Yet Another scripting Language(but worse)

YAL - Yet Another Language YAL is yet another scripting language(but worse). Syntax Basic syntax fun main() { print("Hello, World!"); } Fibonacci

Yet another Python environment manager.

yen The easiest Python environment manager. Create virtual environments for any Python version, without needing Python pre-installed. Installation Get

Golang terminal dashboard
Golang terminal dashboard

termui termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of termbox-go. It is inspired by blessed-c

A crate that allows you to mostly-safely cast one type into another type.

A crate that allows you to mostly-safely cast one type into another type. This is mostly useful for generic functions, e.g. pub fn fooS(s: S) {

Rust crate `needleman_wunsch` of the `fasebare` package: reading FASTA sequences, Needleman-Wunsch alignment

fasebare Rust crate needleman_wunsch of the fasebare package: reading FASTA sequences, Needleman-Wunsch alignment. Synopsis The crate needleman_wunsch

Comments
  • fix typo + faster is_sorted

    fix typo + faster is_sorted

    • Fix typo : InmutableLessSwap -> ImmutableLessSwap

    • IndexSort::is_sorted2() This is an improved version of IndexSort::is_sorted. I didn't replace internal function with is_sorted2 because I'm not sure about its behavior, If you want to replace original function with this new implementation, do it manually (or tell me to do so).

      worst case scenario: O(N/2)

      This implementation compare element at head and tail in same loop (visualize below)

      len = 13
      iter 1: less(1, 0), less(12, 11)
      iter 2: less(2, 1), less(11, 10)
      iter 3: less(3, 2), less(10, 9)
      iter 4: less(4, 3), less(9, 8)
      iter 5: less(5, 4), less(8, 7)
      iter 6: less(6, 5), less(7, 6)
      

      if len is even it will compare middle element twice (less(7, 6) will run twice if len=14)

      result from cargo bench

       is_sorted(10k)          time:   [8.9054 µs 8.9057 µs 8.9059 µs]
       1 (1.00%) low severe
       2 (2.00%) high mild
       2 (2.00%) high severe
      
       is_sorted2(10k)         time:   [6.1242 µs 6.1258 µs 6.1283 µs]
       1 (1.00%) low severe
       2 (2.00%) low mild
       1 (1.00%) high mild
       8 (8.00%) high severe
      
       is_sorted(100m)         time:   [115.44 ms 117.43 ms 119.60 ms]
       1 (1.00%) high mild
      
       is_sorted2(100m)        time:   [84.528 ms 84.769 ms 84.978 ms]
       5 (5.00%) low severe
       3 (3.00%) low mild
       1 (1.00%) high mild
      
    opened by Wireless4024 0
Owner
Al Liu
Rustacean/Gopher, distributed system engineer. In the previous two years, writing Go, but now, writing Rust most of the time.
Al Liu
A blazingly fast Insertion Sort and Quick Sort visualizer built with Rust and WASM.

sortysort A blazingly fast Insertion Sort and Quick Sort visualizer built with Rust and WASM. Try it in your browser from here Testing locally cargo r

null 3 Jan 28, 2022
⚡🦀 Yet another rust system info fetcher.

Yarsi: Yet another rust sys info fetcher ✨ Showcase requirements ?? cargo ?? install with $ curl https://sh.rustup.rs -sSf | sh installation ❤️‍?? Ya

BinaryBrainiacs 8 Jan 26, 2023
Yet another command-line chat GPT frontend written in Rust.

gpterm Yet another command-line chat GPT frontend written in Rust. Features Stream output with typing effect Store chat messages/history Context aware

Makis Christou 22 May 4, 2023
Yet another code execution engine written in Rust.

exec Yet another blazingly fast code execution engine written in Rust. Paths GET /api/v1/status GET /api/v1/runtimes POST /api/v1/execute POST /api/v1

Stefan Asandei 2 Jul 11, 2023
Nerf is (yet another) rust GUI lib

NERF Nerf is (yet another) rust GUI lib. It is heavily inspired by Flutter, and is designed to build apps that could run on any plateforms, such as wi

Eclipse 14 Jul 27, 2023
Yay - Yet another Yogurt - An AUR Helper written in Go

Yay Yet Another Yogurt - An AUR Helper Written in Go Help translate yay: Transifex Features Advanced dependency solving PKGBUILD downloading from ABS

J Guerreiro 8.6k Jan 1, 2023
yet another typing test, but crab flavoured

toipe A trusty terminal typing tester for the tux. Usage Install cargo install toipe Run typing test toipe looks best on a nice terminal (such as Ala

Samyak Sarnayak 431 Dec 20, 2022
Yet another fractal generator (based on glium)

Juliabrot Yet another fractal generator. Juliabrot is a Rust application using the OpenGL Framework to render in realtime. Install Rust To download Ru

Max 2 Feb 27, 2022
Yet another Codeforces cli

cf-tool-rs A Rust implement for https://github.com/xalanq/cf-tool WIP. Pull Requests / Contributions are welcomed! How to Configure? Configure File sh

Woshiluo Luo 2 May 8, 2022
Yet Another Kalman Filter Implementation. As well as Lie Theory (Lie group and algebra) on SE(3). [no_std] is supported by default.

yakf - Yet Another Kalman Filter Yet Another Kalman Filter Implementation, as well as, Lie Theory (Lie group, algebra, vector) on SO(3), SE(3), SO(2),

null 7 Dec 1, 2022