From 39fe7d65ad79f0dda9dc7bc681789cbdd628b02e Mon Sep 17 00:00:00 2001 From: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> Date: Fri, 3 Oct 2025 00:38:47 +0000 Subject: [PATCH 1/4] Do initial setup for trees structure Signed-off-by: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> --- web/thesauruses/_meta/trees.json | 9 +++++++++ web/thesauruses/meta_info.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 web/thesauruses/_meta/trees.json diff --git a/web/thesauruses/_meta/trees.json b/web/thesauruses/_meta/trees.json new file mode 100644 index 000000000..a9f3441d6 --- /dev/null +++ b/web/thesauruses/_meta/trees.json @@ -0,0 +1,9 @@ +{ + "meta": { + "structure": "trees", + "structure_name": "Trees" + }, + "categories": { + + } +} diff --git a/web/thesauruses/meta_info.json b/web/thesauruses/meta_info.json index 72cbafb29..80cf95f32 100644 --- a/web/thesauruses/meta_info.json +++ b/web/thesauruses/meta_info.json @@ -39,6 +39,7 @@ "operators": "Logical and Mathematical/Arithmetic Operators", "queues_stacks": "Queues and Stacks", "rules_facts": "Rules and Facts", - "strings": "Strings" + "strings": "Strings", + "trees": "Trees" } } From 61d9cc3c3bba2c4b22f02f936c387fa34086dc16 Mon Sep 17 00:00:00 2001 From: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> Date: Fri, 3 Oct 2025 05:02:08 +0000 Subject: [PATCH 2/4] Add creation, insertion, traversals and deletion categories and descriptions to trees.json Signed-off-by: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> --- web/thesauruses/_meta/trees.json | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/web/thesauruses/_meta/trees.json b/web/thesauruses/_meta/trees.json index a9f3441d6..e1b25c9d2 100644 --- a/web/thesauruses/_meta/trees.json +++ b/web/thesauruses/_meta/trees.json @@ -4,6 +4,39 @@ "structure_name": "Trees" }, "categories": { - + "Creating Basic Tree Objects":{ + "structure_of_node": "What data structure do you create the tree node with?", + "information_inside_node": "Information stored inside of a node", + "create_node_class": "Creating the node class or struct", + "create_a_node_object": "Creating an object of the node class or struct", + "create_tree_class": "Creating the tree class", + "create_a_tree_object": "Creating an object of the tree class" + }, + "Insertions": { + "insert_node_in_empty_tree": "Inserting a new node in an empty tree", + "insert_node_in_binary_tree": "Inserting a node with a given value in a binary tree", + "insert_node_in_bst_recursion": "Inserting a node with a given value in a binary search tree using recursion", + "insert_node_in_bst_iteration": "Inserting a node with a given value in a binary search tree using iteration", + "insert_node_in_avl_tree": "Inserting a node with a given value in an AVL tree" + }, + "Depth-First Traversals":{ + "inorder_tree_traversal": "Inorder Tree Traversal", + "preorder_tree_traversal": "Pre-order Tree Traversal", + "postorder_tree_traversal": "Post-order Tree Traversal" + }, + "Breadth-First Traversals":{ + "level_order_tree_traversal_recursion": "Level Order Tree Traversal using recursion", + "level_order_tree_traversal_queues": "Level Order Tree Traversal using queues" + }, + "Deletions":{ + "delete_node_binary_tree": "Deleting a node with a given value from a binary tree", + "delete_leaf_node_bst": "Deleting a leaf node from a binary search tree", + "delete_node_with_single_child_bst": "Deleting a node with a single child from a binary search tree", + "delete_node_with_both_children_bst": "Deleting a node with both children from a binary search tree" + }, + "Search":{ + + } + } } From 0497cf2fbecd6821dd5781af26c161b0a8931212 Mon Sep 17 00:00:00 2001 From: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> Date: Fri, 3 Oct 2025 23:09:29 +0000 Subject: [PATCH 3/4] Enhance trees.json with additional categories and detailed descriptions for tree operations Signed-off-by: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> --- web/thesauruses/_meta/trees.json | 80 +++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 12 deletions(-) diff --git a/web/thesauruses/_meta/trees.json b/web/thesauruses/_meta/trees.json index e1b25c9d2..f58c4762d 100644 --- a/web/thesauruses/_meta/trees.json +++ b/web/thesauruses/_meta/trees.json @@ -10,32 +10,88 @@ "create_node_class": "Creating the node class or struct", "create_a_node_object": "Creating an object of the node class or struct", "create_tree_class": "Creating the tree class", - "create_a_tree_object": "Creating an object of the tree class" - }, - "Insertions": { - "insert_node_in_empty_tree": "Inserting a new node in an empty tree", - "insert_node_in_binary_tree": "Inserting a node with a given value in a binary tree", - "insert_node_in_bst_recursion": "Inserting a node with a given value in a binary search tree using recursion", - "insert_node_in_bst_iteration": "Inserting a node with a given value in a binary search tree using iteration", - "insert_node_in_avl_tree": "Inserting a node with a given value in an AVL tree" + "create_a_tree_object": "Creating an object of the tree class", + "create_node_for_tst": "Creating a node for a ternary search tree (TST)", + "create_n_ary_trees": "Creating N-ary trees", + "create_btree_node": "Creating a node for a B-tree", + "create_btree": "Creating a B-tree", + "create_b+tree_node": "Creating a node for a B+ tree", + "create_b+tree": "Creating a B+ tree" }, "Depth-First Traversals":{ "inorder_tree_traversal": "Inorder Tree Traversal", "preorder_tree_traversal": "Pre-order Tree Traversal", - "postorder_tree_traversal": "Post-order Tree Traversal" + "postorder_tree_traversal": "Post-order Tree Traversal", + "tst_tree_traversal": "Ternary Search Tree (TST) Traversal", + "n_ary_tree_level_order_traversal": "N-ary Tree Level Order Traversal using DFS", + "btree_traversal": "B-tree Traversal" }, "Breadth-First Traversals":{ "level_order_tree_traversal_recursion": "Level Order Tree Traversal using recursion", - "level_order_tree_traversal_queues": "Level Order Tree Traversal using queues" + "level_order_tree_traversal_queues": "Level Order Tree Traversal using queues", + "n_ary_tree_level_order_traversal": "N-ary Tree Level Order Traversal using BFS" + }, + "Balancing Trees":{ + "is_balanced_binary_tree": "Check if a binary tree is height-balanced", + "balance_factor_of_node": "Finding the balance factor of a node in an AVL tree", + "right_rotation_avl_tree": "Right rotation in an AVL tree", + "left_rotation_avl_tree": "Left rotation in an AVL tree", + "left_right_rotation_avl_tree": "Left-Right rotation in an AVL tree", + "right_left_rotation_avl_tree": "Right-Left rotation in an AVL tree", + "rebalance_avl_tree": "Rebalancing an AVL tree after insertion or deletion", + "is_red_black_tree": "Check if a binary tree is a valid Red-Black tree" + }, + "Insertions": { + "insert_node_in_empty_tree": "Inserting a new node in an empty tree", + "insert_node_in_binary_tree": "Inserting a node with a given value in a binary tree", + "insert_node_in_bst_recursion": "Inserting a node with a given value in a binary search tree using recursion", + "insert_node_in_bst_iteration": "Inserting a node with a given value in a binary search tree using iteration", + "insert_node_in_avl_tree": "Inserting a node with a given value in an AVL tree", + "insert_node_in_red_black_tree_black_parent": "Inserting a node in a Red-Black tree when the parent is black", + "insert_node_in_red_black_tree_red_parent_and_uncle": "Inserting a node in a Red-Black tree when the parent and uncle are red", + "insert_node_in_red_black_tree_red_parent_and_black_uncle": "Inserting a node in a Red-Black tree when the parent is red and uncle is black", + "insert_node_in_red_black_tree_top_down_insertion": "Top-down insertion in a Red-Black tree", + "insert_node_in_tst": "Inserting a word in a ternary search tree (TST)", + "insert_node_in_btree": "Inserting an element in a B-tree", + "insert_node_in_parent_b+tree": "Inserting an element in a parent node of a B+ tree", + "insert_node_in_leaf_b+tree": "Inserting an element in a leaf node of a B+ tree", + "insert_node_in_b+tree": "Inserting an element in a B+ tree" }, "Deletions":{ "delete_node_binary_tree": "Deleting a node with a given value from a binary tree", "delete_leaf_node_bst": "Deleting a leaf node from a binary search tree", "delete_node_with_single_child_bst": "Deleting a node with a single child from a binary search tree", - "delete_node_with_both_children_bst": "Deleting a node with both children from a binary search tree" + "delete_node_with_both_children_bst": "Deleting a node with both children from a binary search tree", + "delete_node_avl_tree": "Deleting a node with a given value from an AVL tree", + "delete_black_node_red_sibling_red_black_tree": "Deleting a black node with a red sibling node from a Red-Black tree", + "delete_black_node_black_sibling_black_children_red_black_tree": "Deleting a black node with a black sibling node that has black children from a Red-Black tree", + "delete_black_node_black_sibling_far_red_child_red_black_tree": "Deleting a black node with a black sibling node that has a far red child from a Red-Black tree", + "delete_black_node_black_sibling_near_red_child_red_black_tree": "Deleting a black node with a black sibling node that has a near red child from a Red-Black tree", + "delete_node_in_tst": "Deleting a word from a ternary search tree (TST)", + "delete_node_in_btree": "Deleting an element from a B-tree", + "delete_node_in_b+tree": "Deleting an element from a B+ tree" }, "Search":{ - + "search_value_in_binary_tree": "Searching for a value in a binary tree", + "search_value_in_bst_recursion": "Searching for a value in a binary search tree using recursion", + "search_value_in_bst_iteration": "Searching for a value in a binary search tree using iteration", + "search_word_in_tst": "Searching for a word in a ternary search tree (TST)", + "search_element_in_btree": "Searching for an element in a B-tree", + "search_element_in_b+tree": "Searching for an element in a B+ tree" + }, + "Find":{ + "find_minimum_value_in_bst": "Finding the minimum value in a binary search tree", + "find_maximum_value_in_bst": "Finding the maximum value in a binary search tree", + "find_height_of_tree": "Finding the height of a tree", + "find_depth_of_node": "Finding the depth of a node in a tree", + "find_lca_binary_tree": "Finding the lowest common ancestor (LCA) of two nodes in a binary tree", + "find_lca_bst": "Finding the lowest common ancestor (LCA) of two nodes in a binary search tree", + "find_kth_smallest_element_bst": "Finding the k-th smallest element in a binary search tree", + "find_kth_largest_element_bst": "Finding the k-th largest element in a binary search tree", + "find_diameter_of_tree": "Finding the diameter of a tree", + "find_level_of_node": "Finding the level of a node in a tree", + "find_parent_node_btree": "Finding the parent node of a given node in a B-tree", + "find_predecessor_successor_bst": "Finding the predecessor and successor of a given node in a binary search tree" } } From 86ab09f02ad13212553d5bf497f03fec51b9366e Mon Sep 17 00:00:00 2001 From: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> Date: Sun, 12 Oct 2025 06:16:57 +0000 Subject: [PATCH 4/4] Consolidated some of the insertions together Signed-off-by: Maisha Supritee Chowdhury <74114117+maishaSupritee@users.noreply.github.com> --- web/thesauruses/_meta/trees.json | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/web/thesauruses/_meta/trees.json b/web/thesauruses/_meta/trees.json index f58c4762d..d31eb8de6 100644 --- a/web/thesauruses/_meta/trees.json +++ b/web/thesauruses/_meta/trees.json @@ -42,20 +42,16 @@ "is_red_black_tree": "Check if a binary tree is a valid Red-Black tree" }, "Insertions": { - "insert_node_in_empty_tree": "Inserting a new node in an empty tree", - "insert_node_in_binary_tree": "Inserting a node with a given value in a binary tree", - "insert_node_in_bst_recursion": "Inserting a node with a given value in a binary search tree using recursion", - "insert_node_in_bst_iteration": "Inserting a node with a given value in a binary search tree using iteration", + "insert_node_in_tree": "Inserting a new node in a binary tree", + "insert_node_in_bst": "Inserting a node with a given value in a binary search tree", "insert_node_in_avl_tree": "Inserting a node with a given value in an AVL tree", "insert_node_in_red_black_tree_black_parent": "Inserting a node in a Red-Black tree when the parent is black", "insert_node_in_red_black_tree_red_parent_and_uncle": "Inserting a node in a Red-Black tree when the parent and uncle are red", "insert_node_in_red_black_tree_red_parent_and_black_uncle": "Inserting a node in a Red-Black tree when the parent is red and uncle is black", - "insert_node_in_red_black_tree_top_down_insertion": "Top-down insertion in a Red-Black tree", "insert_node_in_tst": "Inserting a word in a ternary search tree (TST)", "insert_node_in_btree": "Inserting an element in a B-tree", "insert_node_in_parent_b+tree": "Inserting an element in a parent node of a B+ tree", - "insert_node_in_leaf_b+tree": "Inserting an element in a leaf node of a B+ tree", - "insert_node_in_b+tree": "Inserting an element in a B+ tree" + "insert_node_in_leaf_b+tree": "Inserting an element in a leaf node of a B+ tree" }, "Deletions":{ "delete_node_binary_tree": "Deleting a node with a given value from a binary tree",