Documentation
¶
Overview ¶
Package binarytree implements binary search tree operations on arrays.
For any given sorted array, Copy permutes the array so that for each item with index i, the item at 2i+1 is smaller and the item at 2i+2 is larger. This permits O(log n) binary searches with strictly monotonically increasing indexes.
Algorithm from casync (camakebst.c), originally by L. Bressel, 2017.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy rearranges a sorted array of size n into a binary search tree array. For each item at index i, items at 2i+1 are smaller and 2i+2 are larger. copyFunc is called with (sourceIndex, destinationIndex) for each element.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.