Data Structures algorithms.
+
for std::to_string
Data-structure algorithms.
-
Algorithms with data structures.
+
Algorithms with data structures.
+
for std::array for assert for std::ofstream for std::cout for std::unique_ptr for std::queue
+
Algorithms with data structures
diff --git a/d5/d3c/namespacedata__structures.js b/d5/d3c/namespacedata__structures.js
index 778471e43..7bfbc63fb 100644
--- a/d5/d3c/namespacedata__structures.js
+++ b/d5/d3c/namespacedata__structures.js
@@ -7,6 +7,10 @@ var namespacedata__structures =
[ "queue_using_array", null, [
[ "Queue_Array", "d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html", "d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array" ]
] ],
+ [ "tree_234", null, [
+ [ "Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html", "dd/d40/classdata__structures_1_1tree__234_1_1_node" ],
+ [ "Tree234", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234.html", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234" ]
+ ] ],
[ "Node", "d9/d49/structdata__structures_1_1_node.html", "d9/d49/structdata__structures_1_1_node" ],
[ "SkipList", "d4/d90/classdata__structures_1_1_skip_list.html", "d4/d90/classdata__structures_1_1_skip_list" ],
[ "trie", "d0/d3e/classdata__structures_1_1trie.html", "d0/d3e/classdata__structures_1_1trie" ]
diff --git a/d5/d88/md__d_i_r_e_c_t_o_r_y.html b/d5/d88/md__d_i_r_e_c_t_o_r_y.html
index 02c9c8850..467559b76 100644
--- a/d5/d88/md__d_i_r_e_c_t_o_r_y.html
+++ b/d5/d88/md__d_i_r_e_c_t_o_r_y.html
@@ -148,6 +148,7 @@ Data Structures
Test Stack
Test Stack Students
Tree
+Tree 234
Trie Modern
Trie Tree
diff --git a/d6/dab/namespacetree__234.html b/d6/dab/namespacetree__234.html
new file mode 100644
index 000000000..353521bc3
--- /dev/null
+++ b/d6/dab/namespacetree__234.html
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+Algorithms_in_C++: tree_234 Namespace Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Functions for 2–3–4 tree
+More...
+
+
Functions for 2–3–4 tree
+
+
+
+
+
+
diff --git a/d7/d61/classdata__structures_1_1tree__234_1_1_node-members.html b/d7/d61/classdata__structures_1_1tree__234_1_1_node-members.html
new file mode 100644
index 000000000..689f58b52
--- /dev/null
+++ b/d7/d61/classdata__structures_1_1tree__234_1_1_node-members.html
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+Algorithms_in_C++: Member List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This is the complete list of members for data_structures::tree_234::Node , including all inherited members.
+
+
+
+
+
+
diff --git a/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.map b/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.map
new file mode 100644
index 000000000..6ad4ffd67
--- /dev/null
+++ b/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.map
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.md5 b/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.md5
new file mode 100644
index 000000000..3ceda7b80
--- /dev/null
+++ b/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.md5
@@ -0,0 +1 @@
+e20696daf2a134c47cb5c1a10cdcfb06
\ No newline at end of file
diff --git a/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.svg b/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.svg
new file mode 100644
index 000000000..4f3dbdde6
--- /dev/null
+++ b/d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.svg
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+data_structures::tree_234::Node
+
+
+
+Node1
+
+
+data_structures::tree
+_234::Node
+
+
+
+
+
+Node2
+
+
+std::array< data_structures
+::tree_234::Node *, 4 >
+
+
+
+
+
+Node1->Node2
+
+
+ elements
+
+
+
+Node2->Node1
+
+
+ children
+
+
+
+Node3
+
+
+std::array< int64_t, 3 >
+
+
+
+
+
+Node3->Node1
+
+
+ items
+
+
+
+Node4
+
+
+std::int64_t
+
+
+
+
+
+Node4->Node3
+
+
+ elements
+
+
+
diff --git a/d8/d95/vector__ops_8hpp_source.html b/d8/d95/vector__ops_8hpp_source.html
index 1de387f78..cc3aeb4a5 100644
--- a/d8/d95/vector__ops_8hpp_source.html
+++ b/d8/d95/vector__ops_8hpp_source.html
@@ -617,13 +617,16 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
void pop()
Definition: stack.h:99
Functions for Palindrome Partitioning algorithm.
bool is_armstrong(int number)
Definition: armstrong_number.cpp:36
+int64_t GetMinItem()
get min item (leftmost) in the current node
Definition: tree_234.cpp:126
void addEdge(std::vector< std::vector< std::pair< int, int >>> *adj, int u, int v, int w)
Function that add edge between two nodes or vertices of graph.
Definition: dijkstra.cpp:48
+Node * GetLeftmostChild()
Get leftmose child of the current node.
Definition: tree_234.cpp:271
int Bidijkstra(std::vector< std::vector< std::pair< uint64_t, uint64_t >>> *adj1, std::vector< std::vector< std::pair< uint64_t, uint64_t >>> *adj2, uint64_t s, uint64_t t)
Function runs the dijkstra algorithm for some source vertex and target vertex in the graph and return...
Definition: bidirectional_dijkstra.cpp:86
void uniform_random_initialization(std::vector< std::valarray< T >> &A, const std::pair< size_t, size_t > &shape, const T &low, const T &high)
Definition: vector_ops.hpp:166
T setprecision(T... args)
+bool Contains(int64_t item)
Check if item is in the node.
Definition: tree_234.cpp:92
int key
key value
Definition: linear_probing_hash_table.cpp:37
@@ -656,13 +659,16 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
T inner_product(T... args)
int m
m is the number of vertices on left side of Bipartite Graph
Definition: hopcroft_karp.cpp:68
Entry(int key=notPresent)
constructor
Definition: linear_probing_hash_table.cpp:36
+void SetChild(int8_t index, Node *child)
Set child pointer to the position of index.
Definition: tree_234.cpp:259
std::vector< std::valarray< T > > operator/(const std::vector< std::valarray< T >> &A, const T &val)
Definition: vector_ops.hpp:365
std::vector< T > operator+(std::vector< T > const &A, std::vector< T > const &B)
Definition: ordinary_least_squares_regressor.cpp:204
+int64_t GetMaxItem()
Get max item (rightmost) in the current node.
Definition: tree_234.cpp:120
int n
n is the number of vertices on right side of Bipartite Graph
Definition: hopcroft_karp.cpp:69
bool putProber(const Entry &entry, int key)
Definition: linear_probing_hash_table.cpp:98
+bool TryLeftRotate(Node *parent, Node *to_child)
A handy function to try if we can do a left rotate to the target node.
Definition: tree_234.cpp:778
std::valarray< T > pop_front(const std::valarray< T > &A)
Definition: vector_ops.hpp:102
An implementation of hash table using double hashing algorithm.
@@ -684,7 +690,9 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
An implementation of hash table using quadratic probing algorithm.
+void Print(const char *file_name=nullptr)
Print tree into a dot file.
Definition: tree_234.cpp:1131
void test1()
Definition: kohonen_som_topology.cpp:369
+std::array< int64_t, 3 > items
store items
Definition: tree_234.cpp:315
void insert(const std::string &str)
Definition: trie_tree.cpp:77
double fit(const std::vector< double > &x, const int &y)
Definition: adaline_learning.cpp:119
@@ -693,8 +701,12 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
ll ans(ll n)
Definition: matrix_exponentiation.cpp:91
Entry(int key=notPresent)
constructor
Definition: double_hash_hash_table.cpp:37
+int64_t GetItem(int8_t index)
Get item of the \index index.
Definition: tree_234.cpp:133
+void RightRotate(Node *parent, int8_t index)
Do the actual right rotate operation.
Definition: tree_234.cpp:845
+int main(int argc, char *argv[])
Main function.
Definition: tree_234.cpp:1298
NeuralNetwork load_model(const std::string &file_name)
Definition: neural_network.cpp:732
std::string scs(const std::string &str1, const std::string &str2)
Definition: shortest_common_supersequence.cpp:42
+void LeftRotate(Node *parent, int8_t index)
Do the actual left rotate operation.
Definition: tree_234.cpp:869
int main(int argc, char **argv)
Definition: kohonen_som_topology.cpp:582
static bool hasChildren(std::shared_ptr< TrieNode > node)
Definition: trie_modern.cpp:41
static void test()
Function to test above algorithm.
Definition: 0_1_knapsack.cpp:96
@@ -709,6 +721,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
void populate_up()
Definition: lowest_common_ancestor.cpp:212
int partition(int arr[], int low, int high)
Definition: quick_sort.cpp:37
+
void test_3d_classes(std::vector< std::valarray< double >> *data)
Definition: kohonen_som_trace.cpp:359
NeuralNetwork & operator=(const NeuralNetwork &model)=default
Definition: trie_modern.cpp:26
@@ -742,6 +755,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
std::vector< std::valarray< T > > transpose(const std::vector< std::valarray< T >> &A)
Definition: vector_ops.hpp:382
Entry find(int key)
Definition: quadratic_probing_hash_table.cpp:131
+void InsertPostMerge(int64_t item)
A insert implementation of post-merge.
Definition: tree_234.cpp:637
bool is_square(std::vector< std::vector< T >> const &A)
Definition: ordinary_least_squares_regressor.cpp:59
int activation(double x)
Definition: adaline_learning.cpp:186
size_t hashFxn(int key)
Hash a key. Uses the STL library's std::hash() function.
Definition: linear_probing_hash_table.cpp:46
@@ -760,6 +774,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
Trie implementation for small-case English alphabets a-z
Definition: trie_tree.cpp:25
std::string fill(char c, int n)
Definition: decimal_to_roman_numeral.cpp:15
+
std::ostream & operator<<(std::ostream &out, std::vector< std::valarray< T >> const &A)
Definition: vector_ops.hpp:32
DenseLayer & operator=(DenseLayer &&)=default
bool check_size_match(const std::vector< double > &x)
Definition: adaline_learning.cpp:196
@@ -773,14 +788,18 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
void test1()
Definition: kohonen_som_trace.cpp:233
void add(int x, int h)
create and add a new node with a give value and at a given height
Definition: chaining.cpp:45
+Node * GetItemLeftChild(int8_t item_index)
Get left child of item at item_index.
Definition: tree_234.cpp:278
+void Traverse()
In-order traverse.
Definition: tree_234.cpp:562
void remove(int key)
Definition: quadratic_probing_hash_table.cpp:194
+int8_t count
track the current item count
Definition: tree_234.cpp:319
int linearProbe(int key, bool searching)
Definition: linear_probing_hash_table.cpp:55
std::vector< std::vector< T > > operator*(std::vector< std::vector< T >> const &A, std::vector< std::vector< T >> const &B)
Definition: ordinary_least_squares_regressor.cpp:78
constexpr int MAX_ITER
Definition: adaline_learning.cpp:40
static void test()
Definition: is_graph_bipartite.cpp:136
size_t argmax(const std::vector< std::valarray< T >> &A)
Definition: vector_ops.hpp:307
+static void test1()
simple test to insert a given array and delete some item, and print the tree
Definition: tree_234.cpp:1263
Definition: linkedlist_implentation_usingarray.cpp:14
@@ -790,16 +809,23 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
int main(int argc, char **argv)
Definition: kohonen_som_trace.cpp:457
bool isEndofWord
identifier if a node is terminal node
Definition: trie_tree.cpp:30
void insert(const std::string &word)
Definition: trie_modern.cpp:109
+bool Is34Node()
Check if node is a 3-node or 4-node, this is useful when we delete item from 2-3-4 tree.
Definition: tree_234.cpp:85
std::ostream & operator<<(std::ostream &out, std::vector< std::vector< T >> const &v)
Definition: ordinary_least_squares_regressor.cpp:22
static bool isCyclicDFS(Graph const &graph)
Definition: cycle_check_directed_graph.cpp:212
+Node * GetNextPossibleChild(int64_t item)
Get next node which is possibly contains item.
Definition: tree_234.cpp:304
+Node * GetItemRightChild(int8_t item_index)
Get right child of item at item_index.
Definition: tree_234.cpp:291
void tests()
Definition: dijkstra.cpp:113
double dot_product(const std::array< double, 10 > &x, const std::array< double, 10 > &y, const int &c)
Definition: gram_schmidt.cpp:59
void test3()
Definition: kohonen_som_topology.cpp:537
+
Definition: cycle_check_directed_graph.cpp:158
void evaluate(const std::vector< std::vector< std::valarray< double >>> &X, const std::vector< std::vector< std::valarray< double >>> &Y)
Definition: neural_network.cpp:606
+Functions for 2–3–4 tree
+Node * MergeNode(Node *dst_node, Node *node)
A helper function used during post-merge insert.
Definition: tree_234.cpp:700
void unit_matrix_initialization(std::vector< std::valarray< T >> &A, const std::pair< size_t, size_t > &shape)
Definition: vector_ops.hpp:193
std::vector< std::vector< int > > up
for every vertex stores a list of its ancestors by powers of two For each vertex, the first element o...
Definition: lowest_common_ancestor.cpp:206
std::vector< int > parent
Stores parent of every vertex and for root its own index. The root is technically not its own parent,...
Definition: lowest_common_ancestor.cpp:104
+void DeleteNode(Node *tree)
Recursive release the tree.
Definition: tree_234.cpp:547
int dijkstra(std::vector< std::vector< std::pair< int, int >>> *adj, int s, int t)
Function runs the dijkstra algorithm for some source vertex and target vertex in the graph and return...
Definition: dijkstra.cpp:66
static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)
Definition: cycle_check_directed_graph.cpp:170
RootedTree(const std::vector< std::pair< int, int > > &undirected_edges, int root_)
Constructs the tree by calculating parent for every vertex. Assumes a valid description of a tree is ...
Definition: lowest_common_ancestor.cpp:93
@@ -807,7 +833,9 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
static void tests()
Function to test the provided algorithm above.
Definition: bidirectional_dijkstra.cpp:199
int main()
Definition: line_segment_intersection.cpp:92
int key
key value
Definition: quadratic_probing_hash_table.cpp:39
+int64_t GetTreeMaxItem(Node *tree)
Get the max item of the tree.
Definition: tree_234.cpp:1098
int main()
Definition: connected_components.cpp:127
+static void test2(int64_t n)
simple test to insert continuous number of range [0, n), and print the tree
Definition: tree_234.cpp:1281
void test1(double eta=0.01)
Definition: adaline_learning.cpp:224
int main()
Definition: graph_coloring.cpp:96
@@ -822,9 +850,11 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
int direction(Point first_point, Point second_point, Point third_point)
Definition: line_segment_intersection.cpp:63
int main()
Definition: depth_first_search.cpp:109
+bool Is2Node()
Check if node is a 2-node.
Definition: tree_234.cpp:79
const double eta
learning rate of the algorithm
Definition: adaline_learning.cpp:207
void fit(const std::vector< std::vector< std::valarray< double >>> &X_, const std::vector< std::vector< std::valarray< double >>> &Y_, const int &epochs=100, const double &learning_rate=0.01, const size_t &batch_size=32, const bool &shuffle=true)
Definition: neural_network.cpp:485
+int8_t GetCount()
Get the item count that current saved in the node.
Definition: tree_234.cpp:50
Various activation functions used in Neural network.
double sigmoid(const double &x)
Definition: neural_network.cpp:60
@@ -834,20 +864,24 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
double relu(const double &x)
Definition: neural_network.cpp:74
Edge(unsigned int source, unsigned int destination)
Definition: cycle_check_directed_graph.cpp:40
+
Trie()
constructor to initialise the root of the trie.
Definition: trie_modern.cpp:103
Definition: prims_minimum_spanning_tree.cpp:9
Dynamic Programming algorithms.
-
+
void addEdge(unsigned int source, unsigned int destination)
Definition: cycle_check_directed_graph.cpp:136
+bool IsLeaf()
Check if node is a leaf.
Definition: tree_234.cpp:67
std::valarray< T > insert_element(const std::valarray< T > &A, const T &ele)
Definition: vector_ops.hpp:85
void test()
Definition: armstrong_number.cpp:59
void add(int key)
Definition: quadratic_probing_hash_table.cpp:182
int main()
Main function.
Definition: jumpgame.cpp:65
+void InsertPreSplit(int64_t item)
A insert implementation of pre-split.
Definition: tree_234.cpp:585
std::vector< std::vector< std::valarray< double > > > __detailed_single_prediction(const std::vector< std::valarray< double >> &X)
Definition: neural_network.cpp:289
int main()
Main function.
Definition: bidirectional_dijkstra.cpp:248
double square(const double &x)
Definition: neural_network.cpp:106
int main()
Definition: chaining.cpp:133
+void Insert(int64_t item)
Insert item to tree.
Definition: tree_234.cpp:655
static void test2()
Definition: hamiltons_cycle.cpp:103
int main()
Main function.
Definition: palindrome_partitioning.cpp:128
@@ -865,9 +899,11 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
uint64_t fib(uint64_t n)
Definition: fibonacci_fast.cpp:30
void rehash()
Definition: quadratic_probing_hash_table.cpp:160
Data Structures algorithms.
+std::array< Node *, 4 > children
store the children pointers
Definition: tree_234.cpp:317
void test2()
Definition: kohonen_som_topology.cpp:451
bool on_segment(Point first_point, Point second_point, Point third_point)
Definition: line_segment_intersection.cpp:75
bool is_bipartite()
function to add edges to our graph
Definition: is_graph_bipartite.cpp:106
+Node * Merge(Node *parent, int8_t index)
Merge the item at index of the parent node, and its left and right child.
Definition: tree_234.cpp:895
DenseLayer(const int &neurons, const std::string &activation, const std::pair< size_t, size_t > &kernel_shape, const bool &random_kernel)
Definition: neural_network.cpp:141
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Definition: lowest_common_ancestor.cpp:77
void rehash()
Definition: double_hash_hash_table.cpp:161
@@ -883,19 +919,24 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
static constexpr uint8_t NUM_CHARS
Number of alphabets.
Definition: trie_tree.cpp:27
std::vector< std::vector< int > > adj
adj stores the graph as an adjacency list
Definition: is_graph_bipartite.cpp:56
int main()
Definition: jarvis_algorithm.cpp:176
+void MergeNodeNotFull(Node *dst_node, Node *node)
Merge node to a not-full target node.
Definition: tree_234.cpp:730
int main()
Main function.
Definition: cut_rod.cpp:100
uint8_t char_to_int(const char &ch) const
Convert a character to integer for indexing.
Definition: trie_tree.cpp:38
void fit_from_csv(const std::string &file_name, const bool &last_label, const int &epochs, const double &learning_rate, const bool &normalize, const int &slip_lines=1, const size_t &batch_size=32, const bool &shuffle=true)
Definition: neural_network.cpp:587
void print(uint32_t N, const std::vector< bool > &is_prime)
Definition: sieve_of_eratosthenes.cpp:44
int main(int argc, char **argv)
Definition: hamiltons_cycle.cpp:142
+void SetCount(int8_t c)
Set the item count of the node.
Definition: tree_234.cpp:61
+void PrintNode(std::ofstream &ofs, Node *node, int64_t parent_index, int64_t index, int8_t parent_child_index)
Print the tree to a dot file. You can convert it to picture with graphviz.
Definition: tree_234.cpp:1226
Graph(unsigned int vertices, AdjList &&adjList)
Definition: cycle_check_directed_graph.cpp:76
Definition: neural_network.cpp:247
+bool TryRightRotate(Node *parent, Node *to_child)
A handy function to try if we can do a right rotate to the target node.
Definition: tree_234.cpp:813
Functions for Jarvis’s algorithm.
std::vector< int > side
stores the side of the vertex
Definition: is_graph_bipartite.cpp:58
int save_2d_data(const char *fname, const std::vector< std::valarray< double >> &X)
Definition: kohonen_som_topology.cpp:65
+int64_t GetTreeMinItem(Node *tree)
Get the min item of the tree.
Definition: tree_234.cpp:1115
An implementation of hash table using linear probing algorithm.
void test_lamniscate(std::vector< std::valarray< double >> *data)
Definition: kohonen_som_trace.cpp:277
@@ -910,10 +951,12 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
int main()
Main function.
Definition: 0_1_knapsack.cpp:126
Type top()
Definition: stack.h:93
Definition: jarvis_algorithm.cpp:55
+int InsertItem(int item)
Insert item to the proper position of the node and return the position index.
Definition: tree_234.cpp:163
void add_edge(T u, T v, bool bidir=true)
Definition: breadth_first_search.cpp:74
bool bfs()
This function checks for the possibility of augmented path availability.
Definition: hopcroft_karp.cpp:133
bool hamilton_cycle(const std::vector< std::vector< bool >> &routes)
Definition: hamiltons_cycle.cpp:30
bool deleteString(const std::string &str, int index)
Definition: trie_tree.cpp:134
+Node * RemoveItemByIndex(int8_t index, bool keep_left)
Insert a value to the index position.
Definition: tree_234.cpp:217
void tests()
Definition: connected_components.cpp:93
int data[MAX]
test data
Definition: hash_search.cpp:24
DenseLayer(DenseLayer &&)=default
@@ -933,6 +976,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
int main()
Definition: armstrong_number.cpp:77
std::vector< std::vector< float > > get_inverse(std::vector< std::vector< T >> const &A)
Definition: ordinary_least_squares_regressor.cpp:226
+Node(int64_t item)
Node constructor.
Definition: tree_234.cpp:41
bool search(const std::shared_ptr< trie > &root, const std::string &str, int index)
Definition: trie_tree.cpp:56
std::pair< std::vector< std::vector< std::valarray< double > > >, std::vector< std::vector< std::valarray< double > > > > get_XY_from_csv(const std::string &file_name, const bool &last_label, const bool &normalize, const int &slip_lines=1)
Definition: neural_network.cpp:382
int main()
Main function.
Definition: hopcroft_karp.cpp:306
@@ -954,22 +998,26 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
std::vector< std::list< int > > adj
adj[u] stores adjacents of left side and 0 is used for dummy vertex
Definition: hopcroft_karp.cpp:73
+bool Remove(int64_t item)
Remove item from tree.
Definition: tree_234.cpp:929
HKGraph()
Default Constructor for initialization.
NeuralNetwork & operator=(NeuralNetwork &&)=default
void save_model(const std::string &_file_name)
Definition: neural_network.cpp:652
constexpr double MIN_DISTANCE
Definition: kohonen_som_topology.cpp:129
+bool RemovePreMerge(Node *node, int64_t item)
Main function implement the pre-merge remove operation.
Definition: tree_234.cpp:937
static void test()
Test implementations.
Definition: word_break.cpp:156
void removalInfo(int key)
Definition: linear_probing_hash_table.cpp:201
void show(const struct tower *const F, const struct tower *const T, const struct tower *const U)
Definition: tower_of_hanoi.cpp:19
void tests()
Definition: hopcroft_karp.cpp:255
Definition: huffman.cpp:28
+Node * GetRightmostChild()
Get rightmose child of the current node.
Definition: tree_234.cpp:265
double dsigmoid(const double &x)
Definition: neural_network.cpp:67
static void tests()
Definition: lowest_common_ancestor.cpp:234
double get_clock_diff(clock_t start_t, clock_t end_t)
Definition: kohonen_som_topology.cpp:577
void add(int key)
Definition: double_hash_hash_table.cpp:185
int doubleHash(int key, bool searching)
Performs double hashing to resolve collisions.
Definition: double_hash_hash_table.cpp:71
int main()
Definition: lowest_common_ancestor.cpp:255
+2-3-4 tree class
Definition: tree_234.cpp:323
hash_chain(int mod)
Construct a new chain object.
Definition: chaining.cpp:35
@@ -982,6 +1030,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
void explore(const std::vector< std::vector< int >> *adj, int u, std::vector< bool > *visited)
Utility function for depth first seach algorithm this function explores the vertex which is passed in...
Definition: connected_components.cpp:59
Definition: knapsack.cpp:4
int main()
Definition: linear_probing_hash_table.cpp:224
+Node * SplitNode(Node *node)
Split a 4-node to 1 parent and 2 children, and return the parent node.
Definition: tree_234.cpp:745
bool search(const std::string &str, int index)
Definition: trie_tree.cpp:107
@@ -998,6 +1047,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
DenseLayer(const DenseLayer &layer)=default
std::vector< std::valarray< T > > operator*(const std::vector< std::valarray< T >> &A, const T &val)
Definition: vector_ops.hpp:347
int main()
Main function.
Definition: neural_network.cpp:833
+void InsertItemByIndex(int8_t index, int64_t item, Node *with_child, bool to_left=true)
Insert a value to the index position.
Definition: tree_234.cpp:189
static void test()
Testing function.
Definition: trie_tree.cpp:178
bool check(const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)
Function that checks if the string passed in param can be segmented from position 'pos',...
Definition: word_break.cpp:80
int maxKnapsackValue(const int capacity, const std::array< int, n > &weight, const std::array< int, n > &value)
Picking up all those items whose combined weight is below given capacity and calculating value of tho...
Definition: 0_1_knapsack.cpp:51
@@ -1006,9 +1056,11 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
size_t hashFxn(int key)
Definition: quadratic_probing_hash_table.cpp:46
+Node * root_
root node of the tree
Definition: tree_234.cpp:538
int quadraticProbe(int key, bool searching)
Definition: quadratic_probing_hash_table.cpp:56
char stack[MAX]
Definition: paranthesis_matching.cpp:20
+int8_t GetChildIndex(Node *child)
Get the child's index of the children array.
Definition: tree_234.cpp:237
Implementation of cutting a rod problem.
int key
key value
Definition: double_hash_hash_table.cpp:38
static int orientation(const Point &p, const Point &q, const Point &r)
Definition: jarvis_algorithm.cpp:133
@@ -1024,6 +1076,7 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
int root
Index of the root vertex.
Definition: lowest_common_ancestor.cpp:108
int pal_part(const std::string &str)
Definition: palindrome_partitioning.cpp:45
+Node * GetChild(int8_t index)
Get the child pointer at position of index.
Definition: tree_234.cpp:252
Definition: line_segment_intersection.cpp:12
std::vector< std::valarray< T > > hadamard_product(const std::vector< std::valarray< T >> &A, const std::vector< std::valarray< T >> &B)
Definition: vector_ops.hpp:494
Class for representing graph as an adjacency list.
Definition: is_graph_bipartite.cpp:51
@@ -1045,20 +1098,25 @@ $(document).ready(function(){initNavTree('d8/d95/vector__ops_8hpp_source.html','
void display()
Display the chain.
Definition: chaining.cpp:63
std::vector< int > pair_u
value of vertex 'u' ranges from 1 to m
Definition: hopcroft_karp.cpp:75
int main()
Definition: shortest_common_supersequence.cpp:164
+
+bool IsFull()
Check if node is a full (4-node)
Definition: tree_234.cpp:73
void quickSort(int arr[], int low, int high)
Definition: quick_sort.cpp:63
void test2(double eta=0.01)
Definition: adaline_learning.cpp:262
void test3(double eta=0.01)
Definition: adaline_learning.cpp:313
+void SetItem(int8_t index, int64_t new_item)
Set item value at position of index.
Definition: tree_234.cpp:140
Definition: adaline_learning.cpp:46
static void test3()
Definition: hamiltons_cycle.cpp:122
void zeroes_initialization(std::vector< std::valarray< T >> &A, const std::pair< size_t, size_t > &shape)
Definition: vector_ops.hpp:213
+2-3-4 tree node class
Definition: tree_234.cpp:35
std::map< T, std::list< T > > adjacency_list
Definition: breadth_first_search.cpp:69
std::vector< float > operator/(std::vector< T > const &A, float const scalar)
Definition: ordinary_least_squares_regressor.cpp:174
void kohonen_som_tracer(const std::vector< std::valarray< double >> &X, std::vector< std::valarray< double >> *W, double alpha_min)
Definition: kohonen_som_trace.cpp:149
Various utility functions used in Neural network.
+int8_t GetItemIndex(int64_t item)
Get the index of the item in the node, 0-based.
Definition: tree_234.cpp:107
bool dfs(int u)
This functions checks whether an augmenting path is available exists beginning with free vertex u.
Definition: hopcroft_karp.cpp:191
void addEdge(int u, int v)
Function that add an edge between two nodes or vertices of graph.
Definition: is_graph_bipartite.cpp:83
diff --git a/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.map b/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.map
new file mode 100644
index 000000000..87b49a875
--- /dev/null
+++ b/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.map
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.md5 b/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.md5
new file mode 100644
index 000000000..3e6d1d6b7
--- /dev/null
+++ b/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.md5
@@ -0,0 +1 @@
+1f0494a1a27058d43e328636e0d39c99
\ No newline at end of file
diff --git a/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.svg b/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.svg
new file mode 100644
index 000000000..331285b79
--- /dev/null
+++ b/da/d85/classdata__structures_1_1tree__234_1_1_tree234__coll__graph.svg
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+data_structures::tree_234::Tree234
+
+
+
+Node1
+
+
+data_structures::tree
+_234::Tree234
+
+
+
+
+
+Node2
+
+
+data_structures::tree
+_234::Node
+
+
+
+
+
+Node2->Node1
+
+
+ root_
+
+
+
+Node3
+
+
+std::array< data_structures
+::tree_234::Node *, 4 >
+
+
+
+
+
+Node2->Node3
+
+
+ elements
+
+
+
+Node3->Node2
+
+
+ children
+
+
+
+Node4
+
+
+std::array< int64_t, 3 >
+
+
+
+
+
+Node4->Node2
+
+
+ items
+
+
+
+Node5
+
+
+std::int64_t
+
+
+
+
+
+Node5->Node4
+
+
+ elements
+
+
+
diff --git a/db/dbc/tree__234_8cpp.html b/db/dbc/tree__234_8cpp.html
new file mode 100644
index 000000000..5aa043420
--- /dev/null
+++ b/db/dbc/tree__234_8cpp.html
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+Algorithms_in_C++: data_structures/tree_234.cpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of 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>
+
+
+
+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++) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+void Print(const char *file_name=nullptr)
Print tree into a dot file.
Definition: tree_234.cpp:1131
+void Traverse()
In-order traverse.
Definition: tree_234.cpp:562
+static void test1()
simple test to insert a given array and delete some item, and print the tree
Definition: tree_234.cpp:1263
+
+static void test2(int64_t n)
simple test to insert continuous number of range [0, n), and print the tree
Definition: tree_234.cpp:1281
+
+void Insert(int64_t item)
Insert item to tree.
Definition: tree_234.cpp:655
+2-3-4 tree class
Definition: tree_234.cpp:323
+
+
+
+
diff --git a/db/dbc/tree__234_8cpp.js b/db/dbc/tree__234_8cpp.js
new file mode 100644
index 000000000..02d33a20a
--- /dev/null
+++ b/db/dbc/tree__234_8cpp.js
@@ -0,0 +1,8 @@
+var tree__234_8cpp =
+[
+ [ "Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html", "dd/d40/classdata__structures_1_1tree__234_1_1_node" ],
+ [ "Tree234", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234.html", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234" ],
+ [ "main", "db/dbc/tree__234_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
+ [ "test1", "db/dbc/tree__234_8cpp.html#ae7880ce913f3058a35ff106d5be9e243", null ],
+ [ "test2", "db/dbc/tree__234_8cpp.html#af1ac73779b0fcfbbdce3976c0ca57342", null ]
+];
\ No newline at end of file
diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map
new file mode 100644
index 000000000..965192fff
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5
new file mode 100644
index 000000000..4afab0782
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5
@@ -0,0 +1 @@
+7af86b82c287411a00b90504692d1bcb
\ No newline at end of file
diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg
new file mode 100644
index 000000000..706c615e4
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg
@@ -0,0 +1,786 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+main
+
+
+
+Node1
+
+
+main
+
+
+
+
+
+Node2
+
+
+std::stoi
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+test1
+
+
+
+
+
+Node1->Node3
+
+
+
+
+
+Node38
+
+
+test2
+
+
+
+
+
+Node1->Node38
+
+
+
+
+
+Node4
+
+
+data_structures::tree
+_234::Tree234::Insert
+
+
+
+
+
+Node3->Node4
+
+
+
+
+
+Node14
+
+
+data_structures::tree
+_234::Tree234::Print
+
+
+
+
+
+Node3->Node14
+
+
+
+
+
+Node19
+
+
+data_structures::tree
+_234::Tree234::Remove
+
+
+
+
+
+Node3->Node19
+
+
+
+
+
+Node5
+
+
+data_structures::tree
+_234::Tree234::InsertPreSplit
+
+
+
+
+
+Node4->Node5
+
+
+
+
+
+Node6
+
+
+std::unique_ptr::get
+
+
+
+
+
+Node5->Node6
+
+
+
+
+
+Node7
+
+
+data_structures::tree
+_234::Tree234::MergeNodeNotFull
+
+
+
+
+
+Node5->Node7
+
+
+
+
+
+Node13
+
+
+data_structures::tree
+_234::Tree234::SplitNode
+
+
+
+
+
+Node5->Node13
+
+
+
+
+
+Node8
+
+
+data_structures::tree
+_234::Node::InsertItem
+
+
+
+
+
+Node7->Node8
+
+
+
+
+
+Node11
+
+
+data_structures::tree
+_234::Node::IsFull
+
+
+
+
+
+Node7->Node11
+
+
+
+
+
+Node12
+
+
+data_structures::tree
+_234::Node::SetChild
+
+
+
+
+
+Node7->Node12
+
+
+
+
+
+Node9
+
+
+data_structures::tree
+_234::Node::Contains
+
+
+
+
+
+Node8->Node9
+
+
+
+
+
+Node10
+
+
+data_structures::tree
+_234::Node::InsertItemByIndex
+
+
+
+
+
+Node8->Node10
+
+
+
+
+
+Node8->Node11
+
+
+
+
+
+Node15
+
+
+std::ofstream::close
+
+
+
+
+
+Node14->Node15
+
+
+
+
+
+Node16
+
+
+std::endl
+
+
+
+
+
+Node14->Node16
+
+
+
+
+
+Node17
+
+
+std::ofstream::open
+
+
+
+
+
+Node14->Node17
+
+
+
+
+
+Node18
+
+
+data_structures::tree
+_234::Tree234::PrintNode
+
+
+
+
+
+Node14->Node18
+
+
+
+
+
+Node20
+
+
+data_structures::tree
+_234::Tree234::RemovePreMerge
+
+
+
+
+
+Node19->Node20
+
+
+
+
+
+Node21
+
+
+data_structures::tree
+_234::Tree234::GetTreeMaxItem
+
+
+
+
+
+Node20->Node21
+
+
+
+
+
+Node24
+
+
+data_structures::tree
+_234::Tree234::GetTreeMinItem
+
+
+
+
+
+Node20->Node24
+
+
+
+
+
+Node27
+
+
+data_structures::tree
+_234::Node::Is2Node
+
+
+
+
+
+Node20->Node27
+
+
+
+
+
+Node28
+
+
+data_structures::tree
+_234::Node::Is34Node
+
+
+
+
+
+Node20->Node28
+
+
+
+
+
+Node29
+
+
+data_structures::tree
+_234::Tree234::LeftRotate
+
+
+
+
+
+Node20->Node29
+
+
+
+
+
+Node30
+
+
+data_structures::tree
+_234::Tree234::Merge
+
+
+
+
+
+Node20->Node30
+
+
+
+
+
+Node35
+
+
+data_structures::tree
+_234::Tree234::RightRotate
+
+
+
+
+
+Node20->Node35
+
+
+
+
+
+Node36
+
+
+data_structures::tree
+_234::Tree234::TryLeftRotate
+
+
+
+
+
+Node20->Node36
+
+
+
+
+
+Node37
+
+
+data_structures::tree
+_234::Tree234::TryRightRotate
+
+
+
+
+
+Node20->Node37
+
+
+
+
+
+Node22
+
+
+data_structures::tree
+_234::Node::GetMaxItem
+
+
+
+
+
+Node21->Node22
+
+
+
+
+
+Node23
+
+
+data_structures::tree
+_234::Node::GetRightmostChild
+
+
+
+
+
+Node21->Node23
+
+
+
+
+
+Node25
+
+
+data_structures::tree
+_234::Node::GetLeftmostChild
+
+
+
+
+
+Node24->Node25
+
+
+
+
+
+Node26
+
+
+data_structures::tree
+_234::Node::GetMinItem
+
+
+
+
+
+Node24->Node26
+
+
+
+
+
+Node30->Node12
+
+
+
+
+
+Node30->Node27
+
+
+
+
+
+Node31
+
+
+data_structures::tree
+_234::Node::GetChild
+
+
+
+
+
+Node30->Node31
+
+
+
+
+
+Node32
+
+
+data_structures::tree
+_234::Node::GetItem
+
+
+
+
+
+Node30->Node32
+
+
+
+
+
+Node33
+
+
+data_structures::tree
+_234::Node::SetCount
+
+
+
+
+
+Node30->Node33
+
+
+
+
+
+Node34
+
+
+data_structures::tree
+_234::Node::SetItem
+
+
+
+
+
+Node30->Node34
+
+
+
+
+
+Node36->Node27
+
+
+
+
+
+Node36->Node29
+
+
+
+
+
+Node37->Node27
+
+
+
+
+
+Node37->Node35
+
+
+
+
+
+Node38->Node4
+
+
+
+
+
+Node38->Node14
+
+
+
+
+
+Node39
+
+
+std::to_string
+
+
+
+
+
+Node38->Node39
+
+
+
+
+
+Node40
+
+
+data_structures::tree
+_234::Tree234::Traverse
+
+
+
+
+
+Node38->Node40
+
+
+
+
+
+Node40->Node16
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg
new file mode 100644
index 000000000..0e73d3a29
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg
@@ -0,0 +1,698 @@
+
+
+
+
+
+
+main
+
+
+
+Node1
+
+
+main
+
+
+
+
+
+Node2
+
+
+std::stoi
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+test1
+
+
+
+
+
+Node1->Node3
+
+
+
+
+
+Node38
+
+
+test2
+
+
+
+
+
+Node1->Node38
+
+
+
+
+
+Node4
+
+
+data_structures::tree
+_234::Tree234::Insert
+
+
+
+
+
+Node3->Node4
+
+
+
+
+
+Node14
+
+
+data_structures::tree
+_234::Tree234::Print
+
+
+
+
+
+Node3->Node14
+
+
+
+
+
+Node19
+
+
+data_structures::tree
+_234::Tree234::Remove
+
+
+
+
+
+Node3->Node19
+
+
+
+
+
+Node5
+
+
+data_structures::tree
+_234::Tree234::InsertPreSplit
+
+
+
+
+
+Node4->Node5
+
+
+
+
+
+Node6
+
+
+std::unique_ptr::get
+
+
+
+
+
+Node5->Node6
+
+
+
+
+
+Node7
+
+
+data_structures::tree
+_234::Tree234::MergeNodeNotFull
+
+
+
+
+
+Node5->Node7
+
+
+
+
+
+Node13
+
+
+data_structures::tree
+_234::Tree234::SplitNode
+
+
+
+
+
+Node5->Node13
+
+
+
+
+
+Node8
+
+
+data_structures::tree
+_234::Node::InsertItem
+
+
+
+
+
+Node7->Node8
+
+
+
+
+
+Node11
+
+
+data_structures::tree
+_234::Node::IsFull
+
+
+
+
+
+Node7->Node11
+
+
+
+
+
+Node12
+
+
+data_structures::tree
+_234::Node::SetChild
+
+
+
+
+
+Node7->Node12
+
+
+
+
+
+Node9
+
+
+data_structures::tree
+_234::Node::Contains
+
+
+
+
+
+Node8->Node9
+
+
+
+
+
+Node10
+
+
+data_structures::tree
+_234::Node::InsertItemByIndex
+
+
+
+
+
+Node8->Node10
+
+
+
+
+
+Node8->Node11
+
+
+
+
+
+Node15
+
+
+std::ofstream::close
+
+
+
+
+
+Node14->Node15
+
+
+
+
+
+Node16
+
+
+std::endl
+
+
+
+
+
+Node14->Node16
+
+
+
+
+
+Node17
+
+
+std::ofstream::open
+
+
+
+
+
+Node14->Node17
+
+
+
+
+
+Node18
+
+
+data_structures::tree
+_234::Tree234::PrintNode
+
+
+
+
+
+Node14->Node18
+
+
+
+
+
+Node20
+
+
+data_structures::tree
+_234::Tree234::RemovePreMerge
+
+
+
+
+
+Node19->Node20
+
+
+
+
+
+Node21
+
+
+data_structures::tree
+_234::Tree234::GetTreeMaxItem
+
+
+
+
+
+Node20->Node21
+
+
+
+
+
+Node24
+
+
+data_structures::tree
+_234::Tree234::GetTreeMinItem
+
+
+
+
+
+Node20->Node24
+
+
+
+
+
+Node27
+
+
+data_structures::tree
+_234::Node::Is2Node
+
+
+
+
+
+Node20->Node27
+
+
+
+
+
+Node28
+
+
+data_structures::tree
+_234::Node::Is34Node
+
+
+
+
+
+Node20->Node28
+
+
+
+
+
+Node29
+
+
+data_structures::tree
+_234::Tree234::LeftRotate
+
+
+
+
+
+Node20->Node29
+
+
+
+
+
+Node30
+
+
+data_structures::tree
+_234::Tree234::Merge
+
+
+
+
+
+Node20->Node30
+
+
+
+
+
+Node35
+
+
+data_structures::tree
+_234::Tree234::RightRotate
+
+
+
+
+
+Node20->Node35
+
+
+
+
+
+Node36
+
+
+data_structures::tree
+_234::Tree234::TryLeftRotate
+
+
+
+
+
+Node20->Node36
+
+
+
+
+
+Node37
+
+
+data_structures::tree
+_234::Tree234::TryRightRotate
+
+
+
+
+
+Node20->Node37
+
+
+
+
+
+Node22
+
+
+data_structures::tree
+_234::Node::GetMaxItem
+
+
+
+
+
+Node21->Node22
+
+
+
+
+
+Node23
+
+
+data_structures::tree
+_234::Node::GetRightmostChild
+
+
+
+
+
+Node21->Node23
+
+
+
+
+
+Node25
+
+
+data_structures::tree
+_234::Node::GetLeftmostChild
+
+
+
+
+
+Node24->Node25
+
+
+
+
+
+Node26
+
+
+data_structures::tree
+_234::Node::GetMinItem
+
+
+
+
+
+Node24->Node26
+
+
+
+
+
+Node30->Node12
+
+
+
+
+
+Node30->Node27
+
+
+
+
+
+Node31
+
+
+data_structures::tree
+_234::Node::GetChild
+
+
+
+
+
+Node30->Node31
+
+
+
+
+
+Node32
+
+
+data_structures::tree
+_234::Node::GetItem
+
+
+
+
+
+Node30->Node32
+
+
+
+
+
+Node33
+
+
+data_structures::tree
+_234::Node::SetCount
+
+
+
+
+
+Node30->Node33
+
+
+
+
+
+Node34
+
+
+data_structures::tree
+_234::Node::SetItem
+
+
+
+
+
+Node30->Node34
+
+
+
+
+
+Node36->Node27
+
+
+
+
+
+Node36->Node29
+
+
+
+
+
+Node37->Node27
+
+
+
+
+
+Node37->Node35
+
+
+
+
+
+Node38->Node4
+
+
+
+
+
+Node38->Node14
+
+
+
+
+
+Node39
+
+
+std::to_string
+
+
+
+
+
+Node38->Node39
+
+
+
+
+
+Node40
+
+
+data_structures::tree
+_234::Tree234::Traverse
+
+
+
+
+
+Node38->Node40
+
+
+
+
+
+Node40->Node16
+
+
+
+
+
diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map
new file mode 100644
index 000000000..f385dad36
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5 b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5
new file mode 100644
index 000000000..f9e203f5c
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5
@@ -0,0 +1 @@
+aca61c6163d489dcf9126d517b845eb4
\ No newline at end of file
diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg
new file mode 100644
index 000000000..12318c90b
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg
@@ -0,0 +1,389 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test2
+
+
+
+Node1
+
+
+test2
+
+
+
+
+
+Node2
+
+
+data_structures::tree
+_234::Tree234::Insert
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node12
+
+
+data_structures::tree
+_234::Tree234::Print
+
+
+
+
+
+Node1->Node12
+
+
+
+
+
+Node17
+
+
+std::to_string
+
+
+
+
+
+Node1->Node17
+
+
+
+
+
+Node18
+
+
+data_structures::tree
+_234::Tree234::Traverse
+
+
+
+
+
+Node1->Node18
+
+
+
+
+
+Node3
+
+
+data_structures::tree
+_234::Tree234::InsertPreSplit
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node4
+
+
+std::unique_ptr::get
+
+
+
+
+
+Node3->Node4
+
+
+
+
+
+Node5
+
+
+data_structures::tree
+_234::Tree234::MergeNodeNotFull
+
+
+
+
+
+Node3->Node5
+
+
+
+
+
+Node11
+
+
+data_structures::tree
+_234::Tree234::SplitNode
+
+
+
+
+
+Node3->Node11
+
+
+
+
+
+Node6
+
+
+data_structures::tree
+_234::Node::InsertItem
+
+
+
+
+
+Node5->Node6
+
+
+
+
+
+Node9
+
+
+data_structures::tree
+_234::Node::IsFull
+
+
+
+
+
+Node5->Node9
+
+
+
+
+
+Node10
+
+
+data_structures::tree
+_234::Node::SetChild
+
+
+
+
+
+Node5->Node10
+
+
+
+
+
+Node7
+
+
+data_structures::tree
+_234::Node::Contains
+
+
+
+
+
+Node6->Node7
+
+
+
+
+
+Node8
+
+
+data_structures::tree
+_234::Node::InsertItemByIndex
+
+
+
+
+
+Node6->Node8
+
+
+
+
+
+Node6->Node9
+
+
+
+
+
+Node13
+
+
+std::ofstream::close
+
+
+
+
+
+Node12->Node13
+
+
+
+
+
+Node14
+
+
+std::endl
+
+
+
+
+
+Node12->Node14
+
+
+
+
+
+Node15
+
+
+std::ofstream::open
+
+
+
+
+
+Node12->Node15
+
+
+
+
+
+Node16
+
+
+data_structures::tree
+_234::Tree234::PrintNode
+
+
+
+
+
+Node12->Node16
+
+
+
+
+
+Node18->Node14
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph_org.svg b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph_org.svg
new file mode 100644
index 000000000..a261c2005
--- /dev/null
+++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph_org.svg
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+test2
+
+
+
+Node1
+
+
+test2
+
+
+
+
+
+Node2
+
+
+data_structures::tree
+_234::Tree234::Insert
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node12
+
+
+data_structures::tree
+_234::Tree234::Print
+
+
+
+
+
+Node1->Node12
+
+
+
+
+
+Node17
+
+
+std::to_string
+
+
+
+
+
+Node1->Node17
+
+
+
+
+
+Node18
+
+
+data_structures::tree
+_234::Tree234::Traverse
+
+
+
+
+
+Node1->Node18
+
+
+
+
+
+Node3
+
+
+data_structures::tree
+_234::Tree234::InsertPreSplit
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node4
+
+
+std::unique_ptr::get
+
+
+
+
+
+Node3->Node4
+
+
+
+
+
+Node5
+
+
+data_structures::tree
+_234::Tree234::MergeNodeNotFull
+
+
+
+
+
+Node3->Node5
+
+
+
+
+
+Node11
+
+
+data_structures::tree
+_234::Tree234::SplitNode
+
+
+
+
+
+Node3->Node11
+
+
+
+
+
+Node6
+
+
+data_structures::tree
+_234::Node::InsertItem
+
+
+
+
+
+Node5->Node6
+
+
+
+
+
+Node9
+
+
+data_structures::tree
+_234::Node::IsFull
+
+
+
+
+
+Node5->Node9
+
+
+
+
+
+Node10
+
+
+data_structures::tree
+_234::Node::SetChild
+
+
+
+
+
+Node5->Node10
+
+
+
+
+
+Node7
+
+
+data_structures::tree
+_234::Node::Contains
+
+
+
+
+
+Node6->Node7
+
+
+
+
+
+Node8
+
+
+data_structures::tree
+_234::Node::InsertItemByIndex
+
+
+
+
+
+Node6->Node8
+
+
+
+
+
+Node6->Node9
+
+
+
+
+
+Node13
+
+
+std::ofstream::close
+
+
+
+
+
+Node12->Node13
+
+
+
+
+
+Node14
+
+
+std::endl
+
+
+
+
+
+Node12->Node14
+
+
+
+
+
+Node15
+
+
+std::ofstream::open
+
+
+
+
+
+Node12->Node15
+
+
+
+
+
+Node16
+
+
+data_structures::tree
+_234::Tree234::PrintNode
+
+
+
+
+
+Node12->Node16
+
+
+
+
+
+Node18->Node14
+
+
+
+
+
diff --git a/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html b/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html
new file mode 100644
index 000000000..63b930d51
--- /dev/null
+++ b/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+Algorithms_in_C++: Member List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This is the complete list of members for data_structures::tree_234::Tree234 , including all inherited members.
+
+ DeleteNode (Node *tree)data_structures::tree_234::Tree234 private
+ GetTreeMaxItem (Node *tree)data_structures::tree_234::Tree234 private
+ GetTreeMinItem (Node *tree)data_structures::tree_234::Tree234 private
+ Insert (int64_t item)data_structures::tree_234::Tree234
+ Insert (Node *tree, int64_t item)data_structures::tree_234::Tree234 private
+ InsertPostMerge (int64_t item)data_structures::tree_234::Tree234 private
+ InsertPreSplit (int64_t item)data_structures::tree_234::Tree234 private
+ LeftRotate (Node *parent, int8_t index)data_structures::tree_234::Tree234 private
+ Merge (Node *parent, int8_t index)data_structures::tree_234::Tree234 private
+ MergeNode (Node *dst_node, Node *node)data_structures::tree_234::Tree234 private
+ MergeNodeNotFull (Node *dst_node, Node *node)data_structures::tree_234::Tree234 private
+ operator= (const Tree234 &)=delete (defined in data_structures::tree_234::Tree234 )data_structures::tree_234::Tree234
+ operator= (const Tree234 &&)=delete (defined in data_structures::tree_234::Tree234 )data_structures::tree_234::Tree234
+ Print (const char *file_name=nullptr)data_structures::tree_234::Tree234
+ PrintNode (std::ofstream &ofs, Node *node, int64_t parent_index, int64_t index, int8_t parent_child_index)data_structures::tree_234::Tree234 private
+ Remove (int64_t item)data_structures::tree_234::Tree234
+ RemovePreMerge (Node *node, int64_t item)data_structures::tree_234::Tree234 private
+ RightRotate (Node *parent, int8_t index)data_structures::tree_234::Tree234 private
+ root_ data_structures::tree_234::Tree234 private
+ SplitNode (Node *node)data_structures::tree_234::Tree234 private
+ Traverse ()data_structures::tree_234::Tree234
+ Traverse (Node *tree)data_structures::tree_234::Tree234 private
+ Tree234 ()=default (defined in data_structures::tree_234::Tree234 )data_structures::tree_234::Tree234
+ Tree234 (const Tree234 &)=delete (defined in data_structures::tree_234::Tree234 )data_structures::tree_234::Tree234
+ Tree234 (const Tree234 &&)=delete (defined in data_structures::tree_234::Tree234 )data_structures::tree_234::Tree234
+ TryLeftRotate (Node *parent, Node *to_child)data_structures::tree_234::Tree234 private
+ TryRightRotate (Node *parent, Node *to_child)data_structures::tree_234::Tree234 private
+ ~Tree234 () (defined in data_structures::tree_234::Tree234 )data_structures::tree_234::Tree234
+
+
+
+
+
+
diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node.html b/dd/d40/classdata__structures_1_1tree__234_1_1_node.html
new file mode 100644
index 000000000..fb3f7a26b
--- /dev/null
+++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node.html
@@ -0,0 +1,1182 @@
+
+
+
+
+
+
+
+Algorithms_in_C++: data_structures::tree_234::Node Class Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
2-3-4 tree node class
+ More...
+
+
+
+
+
+
+
◆ Node()
+
+
+
+
+
+
+
+
+ data_structures::tree_234::Node::Node
+ (
+ int64_t
+ item )
+
+
+
+
+
+inline explicit
+
+
+
+
+
Node constructor.
+
Parameters
+
+ item the first value we insert to the node
+
+
+
+
+
43 items ({{item, 0, 0}}),
+
44 children ({{
nullptr ,
nullptr ,
nullptr ,
nullptr }}) {}
+
+
+
+
+
+
◆ Contains()
+
+
+
+
+
+
+
+
+ bool data_structures::tree_234::Node::Contains
+ (
+ int64_t
+ item )
+
+
+
+
+
+inline
+
+
+
+
+
Check if item is in the node.
+
Parameters
+
+
+
+
Returns true if item in the node, otherwise false
+
+
93 for (int8_t i = 0; i <
count ; i++) {
+
94 if (item ==
items [i]) {
+
+
+
+
+
+
+
+
+
+
◆ GetChild()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::GetChild
+ (
+ int8_t
+ index )
+
+
+
+
+
+inline
+
+
+
+
+
Get the child pointer at position of index.
+
Parameters
+
+ index index of child to get
+
+
+
+
Returns the child pointer
+
+
+
+
+
◆ GetChildIndex()
+
+
+
+
+
+
+
+
+ int8_t data_structures::tree_234::Node::GetChildIndex
+ (
+ Node *
+ child )
+
+
+
+
+
+inline
+
+
+
+
+
Get the child's index of the children array.
+
Parameters
+
+ child child pointer of which to get the index
+
+
+
+
Returns the index of child
+
+
238 for (int8_t i = 0; i <
count + 1; i++) {
+
+
+
+
+
+
+
+
+
+
+
+
◆ GetCount()
+
+
+
+
+
+
+
+
+ int8_t data_structures::tree_234::Node::GetCount
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Get the item count that current saved in the node.
+
Returns item count
+
+
+
+
+
◆ GetItem()
+
+
+
+
+
+
+
+
+ int64_t data_structures::tree_234::Node::GetItem
+ (
+ int8_t
+ index )
+
+
+
+
+
+inline
+
+
+
+
+
Get item of the \index index.
+
Parameters
+
+ index the item index to get
+
+
+
+
Returns the item
+
133 {
return items [index]; }
+
+
+
+
+
◆ GetItemIndex()
+
+
+
+
+
+
+
+
+ int8_t data_structures::tree_234::Node::GetItemIndex
+ (
+ int64_t
+ item )
+
+
+
+
+
+inline
+
+
+
+
+
Get the index of the item in the node, 0-based.
+
Parameters
+
+
+
+
Returns 0-based index of the item in the node, if not in the node, -1 is returned
+
+
108 for (int8_t i = 0; i <
count ; i++) {
+
109 if (
items [i] == item) {
+
+
+
+
+
+
+
+
+
+
◆ GetItemLeftChild()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::GetItemLeftChild
+ (
+ int8_t
+ item_index )
+
+
+
+
+
+inline
+
+
+
+
+
Get left child of item at item_index.
+
Parameters
+
+ item_index index of the item whose left child to be get
+
+
+
+
Returns left child of items[index]'s
+
+
279 if (item_index < 0 || item_index >
count - 1) {
+
+
+
+
+
+
+
+
+
+
◆ GetItemRightChild()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::GetItemRightChild
+ (
+ int8_t
+ item_index )
+
+
+
+
+
+inline
+
+
+
+
+
Get right child of item at item_index.
+
Parameters
+
+ item_index index of the item whose right child to be get
+
+
+
+
Returns right child of items[index]'s
+
+
292 if (item_index < 0 || item_index >
count - 1) {
+
+
+
+
+
+
+
+
+
+
◆ GetLeftmostChild()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::GetLeftmostChild
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Get leftmose child of the current node.
+
Returns the leftmost child
+
+
+
+
+
◆ GetMaxItem()
+
+
+
+
+
+
+
+
+ int64_t data_structures::tree_234::Node::GetMaxItem
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Get max item (rightmost) in the current node.
+
Returns max item
+
+
+
+
+
◆ GetMinItem()
+
+
+
+
+
+
+
+
+ int64_t data_structures::tree_234::Node::GetMinItem
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
get min item (leftmost) in the current node
+
Returns min item
+
+
+
+
+
◆ GetNextPossibleChild()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::GetNextPossibleChild
+ (
+ int64_t
+ item )
+
+
+
+
+
+inline
+
+
+
+
+
Get next node which is possibly contains item.
+
Parameters
+
+
+
+
Returns the next node that possibly contains item
+
+
+
306 for (i = 0; i <
count ; i++) {
+
307 if (
items [i] > item) {
+
+
+
+
+
+
+
+
+
+
◆ GetRightmostChild()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::GetRightmostChild
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Get rightmose child of the current node.
+
Returns the rightmost child
+
+
+
+
+
◆ InsertItem()
+
+
+
+
+
+
+
+
+ int data_structures::tree_234::Node::InsertItem
+ (
+ int
+ item )
+
+
+
+
+
+inline
+
+
+
+
+
Insert item to the proper position of the node and return the position index.
+
This is a helper function we use during insertion. Please mind that when insert a item, we aslo need to take care of two child pointers. One is the original child pointer at the insertion position. It can be placed as new item's either left child or right child. And the other is the new child that should be added. For our dedicated situation here, we choose to use the original child as the new item's left child, and add a null pointer to its right child. So after use the function, please update these two children pointer manually.
+
Parameters
+
+ item value to be inserted to the node
+
+
+
+
Returns index where item is inserted, caller can use this index to update its left and right child
+
+
+
+
+
+
+
+
+
171 for (i = 0; i <
count ; i++) {
+
172 if (
items [i] > item) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
◆ InsertItemByIndex()
+
+
+
+
+
+
+
+
+ void data_structures::tree_234::Node::InsertItemByIndex
+ (
+ int8_t
+ index ,
+
+
+
+
+ int64_t
+ item ,
+
+
+
+
+ Node *
+ with_child ,
+
+
+
+
+ bool
+ to_left = true
+
+
+
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Insert a value to the index position.
+
Parameters
+
+ index index where to insert item
+ item value to insert
+ with_child new added child pointer
+ to_left true indicate adding with_child to new item's left child, otherwise to right child
+
+
+
+
+
191 assert(count < 3 && index >= 0 && index < 3);
+
+
193 for (int8_t i =
count - 1; i >= index; i--) {
+
+
+
+
+
+
199 int8_t start_index = to_left ? index : index + 1;
+
+
201 for (int8_t i =
count ; i >= start_index; i--) {
+
+
+
+
+
+
+
+
+
+
+
+
◆ Is2Node()
+
+
+
+
+
+
+
+
+ bool data_structures::tree_234::Node::Is2Node
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Check if node is a 2-node.
+
Returns true if node is 2-node, otherwise false
+
79 {
return count == 1; }
+
+
+
+
+
◆ Is34Node()
+
+
+
+
+
+
+
+
+ bool data_structures::tree_234::Node::Is34Node
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Check if node is a 3-node or 4-node, this is useful when we delete item from 2-3-4 tree.
+
Returns true if node is 3-node or 4-node, false otherwise
+
+
+
+
+
◆ IsFull()
+
+
+
+
+
+
+
+
+ bool data_structures::tree_234::Node::IsFull
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Check if node is a full (4-node)
+
Returns true if node is full (4-node), false otherwise
+
73 {
return count == 3; }
+
+
+
+
+
◆ IsLeaf()
+
+
+
+
+
+
+
+
+ bool data_structures::tree_234::Node::IsLeaf
+ (
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Check if node is a leaf.
+
Returns true if node is leaf, false otherwise
+
+
+
+
+
◆ RemoveItemByIndex()
+
+
+
+
+
+
+
+
+ Node * data_structures::tree_234::Node::RemoveItemByIndex
+ (
+ int8_t
+ index ,
+
+
+
+
+ bool
+ keep_left
+
+
+
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Insert a value to the index position.
+
Parameters
+
+ index index of the item to remove
+ keep_left which child of the item to keep, true keep the left child, false keep the right child
+
+
+
+
Returns the removed child pointer
+
+
218 assert(index >= 0 && index <
count );
+
+
220 for (int8_t i = index; i <
count - 1; i++) {
+
+
+
+
224 for (int8_t i = keep_left ? index + 1 : index; i <
count ; i++) {
+
+
+
+
+
229 return removed_child;
+
+
+
+
+
+
◆ SetChild()
+
+
+
+
+
+
+
+
+ void data_structures::tree_234::Node::SetChild
+ (
+ int8_t
+ index ,
+
+
+
+
+ Node *
+ child
+
+
+
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Set child pointer to the position of index.
+
Parameters
+
+ index children index
+ child pointer to set
+
+
+
+
+
+
+
+
◆ SetCount()
+
+
+
+
+
+
+
+
+ void data_structures::tree_234::Node::SetCount
+ (
+ int8_t
+ c )
+
+
+
+
+
+inline
+
+
+
+
+
Set the item count of the node.
+
This is only used when we spliting and merging node where we need to do some raw operation manually. In common inserting and removing operation the count is maintained automatically.
+
Parameters
+
+
+
+
+
+
+
+
◆ SetItem()
+
+
+
+
+
+
+
+
+ void data_structures::tree_234::Node::SetItem
+ (
+ int8_t
+ index ,
+
+
+
+
+ int64_t
+ new_item
+
+
+
+ )
+
+
+
+
+
+inline
+
+
+
+
+
Set item value at position of index.
+
Parameters
+
+ index the index of the item to set
+ new_item item value
+
+
+
+
+
141 assert(index >= 0 && index <= 2);
+
+
143 items [index] = new_item;
+
+
+
+
+
The documentation for this class was generated from the following file:
+
+
+bool Contains(int64_t item)
Check if item is in the node.
Definition: tree_234.cpp:92
+std::array< int64_t, 3 > items
store items
Definition: tree_234.cpp:315
+int8_t count
track the current item count
Definition: tree_234.cpp:319
+Definition: linkedlist_implentation_usingarray.cpp:14
+std::array< Node *, 4 > children
store the children pointers
Definition: tree_234.cpp:317
+void InsertItemByIndex(int8_t index, int64_t item, Node *with_child, bool to_left=true)
Insert a value to the index position.
Definition: tree_234.cpp:189
+bool IsFull()
Check if node is a full (4-node)
Definition: tree_234.cpp:73
+
+
+
+
diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node.js b/dd/d40/classdata__structures_1_1tree__234_1_1_node.js
new file mode 100644
index 000000000..f3f05102b
--- /dev/null
+++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node.js
@@ -0,0 +1,30 @@
+var classdata__structures_1_1tree__234_1_1_node =
+[
+ [ "Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ad5219979ea9a8baa3a273a9ec0f0c670", null ],
+ [ "Contains", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a22fd25c6c811c64b6b27b0850d8c532f", null ],
+ [ "GetChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a5f6d943abaac52a236fe5d945e9d0e25", null ],
+ [ "GetChildIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ad632a0440295bc88ceadae7478fe0d37", null ],
+ [ "GetCount", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#aac82e17daa088ede9ee00dc69c1e6f06", null ],
+ [ "GetItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a4808acb43668ff8cfd6f7cb44ceedad3", null ],
+ [ "GetItemIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a650f0ef26b7450e1addb5d80bb0ed629", null ],
+ [ "GetItemLeftChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a9ba4f652baa900f0634822ec380a6996", null ],
+ [ "GetItemRightChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a976998a7553ab92ef79cc04fac305e5b", null ],
+ [ "GetLeftmostChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a692a971c577511abdf7027e7e92a031b", null ],
+ [ "GetMaxItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a2753b6053b8c86c5bd987a44fdfa0a57", null ],
+ [ "GetMinItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a5438d0a47850f520b2262b5a42f75b71", null ],
+ [ "GetNextPossibleChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a0f60199d0d175c248c67bfad9b9bdafe", null ],
+ [ "GetRightmostChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#abe9725b6422fd974642f9c9618b0f3be", null ],
+ [ "InsertItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a8e809ae85ae00e937f67ddb76951b6bb", null ],
+ [ "InsertItemByIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a306a30931f54c84098b38d6bc8f4a956", null ],
+ [ "Is2Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#afd9f83e2d5d7f22f79c1348e98914631", null ],
+ [ "Is34Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a6c5f929afcbad5219646990edee22e18", null ],
+ [ "IsFull", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a4a37381c0ef93d5ae2118b2e554974dd", null ],
+ [ "IsLeaf", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a607d8201b00b142bf1d6a34df2f936e8", null ],
+ [ "RemoveItemByIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a8384b8c0fdc8e5e443010d2eb1187847", null ],
+ [ "SetChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ab4e5f7b7b260bb81d9441652cc124c74", null ],
+ [ "SetCount", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#af564fd4b0992fff69f90de201542d3d1", null ],
+ [ "SetItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#aaa89a3016b5dd1be3552321c34343cbc", null ],
+ [ "children", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ad5d6b6ce5fab21ccc88c6bf3153eee5d", null ],
+ [ "count", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a934e6d53cfefae2b971e1241a8a4c921", null ],
+ [ "items", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a8417d01c88b99ca56289843509fb71f9", null ]
+];
\ No newline at end of file
diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.map b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.map
new file mode 100644
index 000000000..c0eb05cf7
--- /dev/null
+++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.map
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.md5 b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.md5
new file mode 100644
index 000000000..3f04c13b8
--- /dev/null
+++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.md5
@@ -0,0 +1 @@
+61075ce66e20bb917fcff1c565223865
\ No newline at end of file
diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg
new file mode 100644
index 000000000..fdb03a7f9
--- /dev/null
+++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+data_structures::tree_234::Node::InsertItem
+
+
+
+Node1
+
+
+data_structures::tree
+_234::Node::InsertItem
+
+
+
+
+
+Node2
+
+
+data_structures::tree
+_234::Node::Contains
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+data_structures::tree
+_234::Node::InsertItemByIndex
+
+
+
+
+
+Node1->Node3
+
+
+
+
+
+Node4
+
+
+data_structures::tree
+_234::Node::IsFull
+
+
+
+
+
+Node1->Node4
+
+
+
+
+
diff --git a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html
index 2a22e1091..4e1aee8d1 100644
--- a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html
+++ b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html
@@ -131,6 +131,9 @@ Files