Question: Find all nodes in a BST that are between a range of values. Build a linked list of the values and the list should be
Find all nodes in a BST that are between a range of values. Build a linked list of the values and the list should be in ascending order.
NOTE: head of the linked list is declared globally at the back end and its initial value is NULL. Just add the nodes to the linked list using head. Printing the linked list will also be done in the backend. Helper functions can be used.
void RangeSearch(TreeNode *node, char m, char n);


Find all nodes in a BST that are between a range of values. Build a linked list of the values and the list should be in ascending order. NOTE: head of the linked list is declared globally at the back end and its initial value is NULL. Just add the nodes to the linked list using head. Printing the linked list will also be done in the backend. Helper functions can be used void Range Search (TreeNode node, char m, char n); Tree Struct struct TreeNode char key; TreeNode Left TreeNode right TreeNode *parent Linked list Struct: struct Node char key; Node next Node *head NULL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
