TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
A demo 2-3-4 tree implementation. More...
#include <array>
#include <cassert>
#include <fstream>
#include <iostream>
#include <memory>
#include <queue>
#include <string>
Go to the source code of this file.
Classes | |
class | data_structures::tree_234::Node |
2-3-4 tree node class More... | |
class | data_structures::tree_234::Tree234 |
2-3-4 tree class More... | |
Namespaces | |
namespace | data_structures |
for IO operations | |
namespace | tree_234 |
Functions for 2–3–4 tree | |
Functions | |
static void | test1 () |
simple test to insert a given array and delete some item, and print the tree | |
static void | test2 (int64_t n) |
simple test to insert continuous number of range [0, n), and print the tree | |
int | main (int argc, char *argv[]) |
Main function. | |
A demo 2-3-4 tree implementation.
2–3–4 tree is a self-balancing data structure that is an isometry of red–black trees. Though we seldom use them in practice, we study them to understand the theory behind Red-Black tree. Please read following links for more infomation. 2–3–4 tree 2-3-4 Trees: A Visual Introduction We Only implement some basic and complicated operations in this demo. Other operations should be easy to be added.
Definition in file tree_234.cpp.
int main | ( | int | argc, |
char * | argv[] ) |
Main function.
argc | commandline argument count (ignored) |
argv | commandline array of arguments (ignored) |
Definition at line 1298 of file tree_234.cpp.
|
static |
simple test to insert a given array and delete some item, and print the tree
Definition at line 1263 of file tree_234.cpp.
|
static |
simple test to insert continuous number of range [0, n), and print the tree
n | upper bound of the range number to insert |
Definition at line 1281 of file tree_234.cpp.