#heap #removal #structure #elements #traits #parameters

biheap

A heap group that supports efficient removal of extreme elements

12 releases (4 breaking)

0.5.1 May 22, 2023
0.4.2 May 21, 2023
0.3.5 May 21, 2023
0.2.2 May 19, 2023
0.1.1 May 19, 2023

#1512 in Data structures

Download history 1/week @ 2024-03-07 1/week @ 2024-03-14 3/week @ 2024-03-28 2/week @ 2024-04-04

122 downloads per month

MIT/Apache

74KB
2K SLoC

BiHeap

BiHeap is a implementation of heap structure, to maintain the extreme values of a list of data.

Structure

BiHeap

BiHeap is the core data structure to control the two heaps. Any data follows by Ord trait can be the type parameter of the BiHeap generic struct.

Indexer

The Indexer is a reference to the data in the heap. Actually it doesn't describe the owner of the data, but the position of the data in the heap. It means the data it points out would be 'miss', if you attempt to remove it from the heap.

PeekMut

The PeekMut describes a mutable reference to the data in the heap. It can be used to modify the data in the heap, peek it, reset it, or remove it.

Latest Version Log

  • threadsafe feature added.
  • Add Sync and Send traits for any Indexer.

Others

If you have some questions, welcome on https://github.com/CutieDeng/biheap/issues.

No runtime deps

Features