-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Written some non-update API calls and "add" based update API calls #37
Conversation
- Minor changes to the tree class. - Currently debugging the `add_child()` brute method. - Major target currently, is to fix the update to the bookkeeping. - To add, private `_add_child_brute()` and `_add_child_hashmap()` calls. Which will be called by the public `add_child()`. - To add, random tree generator to test flp.
- The invalidity of a tree_pointer is now reduced to checking if the parent is MAX_VALUE. Reason: The last guy can never be a parent. - Stub implementations added for now, need to add tests and complete the implementation. ## Todos for now: -[] Complete all query based API (other than `get_tree_width`). -[] Complete `add_child` and `append_sibling`. -[] Add pathological tests.
- `get_first_child` - `get_last_child` - `is_first_child` - `is_last_child` > These methods still need to be tested, can't be done until `add_child()` is ready.
…this, and clean it up too.
…emplate defs outside.
…ve to iterate over every child chunk and change it's parent pointer when shifting chunks.
…sert and update sibling_chunk pointers.
- _break_chunk_from - _insert_chunk_after - _fits_in_short_del Refactored a few things and fixed minor bugs. Will refactor, change a few constants and improve the comments, code quality before proceeding with testing/debugging.
WalkthroughThe recent changes across multiple files introduce new classes and data structures for better handling of tree pointers and node relationships. Additionally, a class with specific public and private member functions is added to enhance encapsulation and functionality. This results in optimized storage and manipulation of tree nodes and related operations. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant MyClass
Client->>MyClass: callPrivateFunction()
MyClass->>MyClass: privateFunction()
MyClass->>MyClass: publicFunction()
MyClass-->>Client: Return Response
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- hhds/testing.cpp (1 hunks)
- hhds/tree.cpp (1 hunks)
- hhds/tree.hpp (1 hunks)
Additional comments not posted (5)
hhds/testing.cpp (4)
5-9
: The encapsulation and internal function calling are implemented correctly.
11-13
: Simple and clear implementation of the public function.
15-17
: Good use of public interface to access private functionality.
21-25
: Main function correctly demonstrates the use of class methods.hhds/tree.cpp (1)
109-116
: Proper use of main function to test the size of theTree_pointers
struct.
Tasks Finished
Tree_pos get_last_child(const Tree_pos& parent_index)
Tree_pos get_first_child(const Tree_pos& parent_index)
bool is_last_child(const Tree_pos& self_index)
bool is_first_child(const Tree_pos& self_index)
Tree_pos get_sibling_next(const Tree_pos& sibling_id)
Tree_pos get_sibling_prev(const Tree_pos& sibling_id)
Tree_pos append_sibling(const Tree_pos& sibling_id, const X& data)
Tree_pos add_child(const Tree_pos& parent_index, const X& data)
Tree_pos _break_chunk_from(const Tree_pos abs_id)
that is able to break a chunk into the least number of siblingsCurrent TODOS
INVALID = 0
for every member of theTree_pointers
class.Upcoming TODOS (in order of planned completion)
get_tree_width()
delete_leaf()
delete_subtree()
insert_next_sibling()
Summary by CodeRabbit
New Features
Improvements