Commit Graph

7 Commits

Author SHA1 Message Date
Aryadev Chavali
509c8930e8 (btree)+constructor for structure, cleaned up some code
Might as well use C++ features if I've got them
2023-07-09 16:22:23 +01:00
Aryadev Chavali
6d504da381 (*)~reworking this project 2023-06-25 07:33:06 +01:00
Aryadev Chavali
b58ee52a81 (General)~forgot to format my files
Need to remember to format before each commit
2021-11-26 02:35:23 +00:00
Aryadev Chavali
516325444f (btree)+basic main test for insert 2021-11-23 06:20:39 +00:00
Aryadev Chavali
55a24fc560 (btree)+recursive insert algorithm
Just checks the value of the current node against value, assesses if
the leaf it needs to store it in is a NULL or not, then either
allocates to that leaf or recursively calls insert on that leaf (so it
may sort the value).  Uses pointer magic for some cleaner code.
2021-11-23 06:19:13 +00:00
Aryadev Chavali
8de4860e1d (btree)+struct for binary tree
Has a custom enum for ordering, as each type of data may have its own
comparator system.  Hence, each node will have a comparison function
pointer internally.  Though this increases the data required to create
a binary tree, it does make it easier to support multiple types.
2021-11-23 06:14:06 +00:00
Aryadev Chavali
f8093dceca (btree)+binary tree cpp file with recipes in makefile 2021-11-22 06:22:42 +00:00