Question: Write a binary search tree to store strings. You program should do the following: A. Your program should accept any sentence from the standard
Write a binary search tree to store strings. You program should do the following: A. Your program should accept any sentence from the standard input and separate its words. A word is identified with a space, comma, semicolon, and colon after the last character of each word. For example: Today is a Nice, sunny, and wArm Day. You should get the following tokens: "today", "is", "a", "Nice", "sunny", "and", "wArm" and "Day". B. Insert the tokens into the tree. All the comparisons should be performed based on lower-case characters. However, your program should remember what the original word was. For any output, your program should show the original words. C. Your program should show ascending and descending order of the words in the sentence upon a request. D. Your program should return the height of the tree and any node n; upon a request. E. Your program should be able to delete any node from the tree. F. Your program should show the infix notation of the tree.
Step by Step Solution
There are 3 Steps involved in it
include include include include using namespace std Node structure for the binary search tree struct Node string originalWord ... View full answer
Get step-by-step solutions from verified subject matter experts
