Persistent binary search trees in R

as.bst | Convert a named vector or list to a bst |

bst | Create a new binary search tree |

ceiling_of | Get the smallest key greater than or equal to a given key |

compare_default | Compare two keys |

contains | Does the tree contain a given key? |

delete | Delete a key-value pair from a tree |

delete_max | Delete the maximum from a tree |

delete_min | Delete the minimum from a tree |

floor_of | Get the largest key less than or equal to a given key |

height | The height of a tree |

insert | Insert a key-value pair into a bst |

is_balanced | Is the tree balanced? |

is_empty | Is the tree empty? |

keys | Get all keys (in order) |

keys_between | Find all keys between low and high |

min_key | Get the smallest or largest key |

mockbst | Create a mock bst object for testing and analysis |

retrieve | Retrieve the value associated with a given key |

size | Get the size of a tree |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.