A demo 2-3-4 tree implementation.
More...
#include <array>
#include <cassert>
#include <fstream>
#include <iostream>
#include <memory>
#include <queue>
#include <string>
|
|
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 More...
|
| |
| int | main (int argc, char *argv[]) |
| | Main function. More...
|
| |
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.
- Author
- liuhuan
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Main function.
- Parameters
-
| argc | commandline argument count (ignored) |
| argv | commandline array of arguments (ignored) |
- Returns
- 0 on exit
◆ test2()
| static void test2 |
( |
int64_t |
n | ) |
|
|
static |
simple test to insert continuous number of range [0, n), and print the tree
- Parameters
-
| n | upper bound of the range number to insert |
1284 for (int64_t i = 0; i < n; i++) {