Skip to content
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

B9.0) RB tree accessibility fix & split RB tree implementations #128

Merged
merged 17 commits into from
Jul 18, 2024

Conversation

JithinKS97
Copy link
Contributor

@JithinKS97 JithinKS97 commented Jul 17, 2024

  • Changed RB tree trait from embeddable to internal
  • Refactored RB tree functions into distinct traits for distinct functionalities
  • Split the tree in the following way
  1. RBTreeTrait:
    _insert
    _find
    _update
    _delete

  2. RBTreeOptionRoundTrait:
    find_clearing_price
    get_total_options_sold
    _get_total_options_available
    traverse_postorder_clearing_price_from_node

  3. RBTreeOperationsTrait:
    create_root_node
    create_leaf_node
    is_left_child
    update_left
    update_right
    update_parent
    get_parent
    is_black
    is_red
    ensure_root_is_black
    set_color
    _add_node // Adds a node directly to the tree by accepting parent and value

  4. RBTreeTestingTrait:
    _get_tree_structure
    _is_tree_valid
    get_node_positions_by_level
    build_tree_structure_list
    collect_position_and_levels_of_nodes
    check_if_rb_tree_is_valid
    validate_node

  5. RBTreeDeleteBalanceTrait:
    delete_node
    delete_fixup
    transplant
    minimum
    get_default_node // To replace the deleted node with null node
    get_default_bid

  6. RBTreeInsertBalanceTrait:
    insert_node_recursively
    balance_after_insertion
    balance_left_case
    balance_right_case
    handle_red_uncle
    handle_black_uncle_left
    handle_black_uncle_right

  7. RBTreeRotationsTrait:
    rotate_right
    rotate_left

@JithinKS97 JithinKS97 marked this pull request as draft July 17, 2024 10:47
@JithinKS97 JithinKS97 changed the title Internal Change RB tree public fns to internal Jul 17, 2024
@JithinKS97 JithinKS97 changed the title Change RB tree public fns to internal B9.0) Change RB tree public fns to internal Jul 17, 2024
@JithinKS97 JithinKS97 marked this pull request as ready for review July 17, 2024 11:17
@JithinKS97 JithinKS97 changed the title B9.0) Change RB tree public fns to internal B9.0) RB tree accessibility fix Jul 17, 2024
@JithinKS97 JithinKS97 changed the title B9.0) RB tree accessibility fix B9.0) RB tree accessibility fix & split RB tree implementations Jul 18, 2024
@0xDegenDeveloper 0xDegenDeveloper merged commit bbdce1b into develop Jul 18, 2024
1 of 2 checks passed
@JithinKS97 JithinKS97 deleted the internal branch July 22, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants