Question
I need this written in C++ Enter e string through the keyboard (for end press Ctrl+A). Using the characters in the string create a binary
I need this written in C++
Enter e string through the keyboard (for end press Ctrl+A). Using the characters in the string create a binary search tree and traverse the tree in pre-order, post-order, in-order and level-order. In the newly formed tree, find the node that has the lowest ASCII code value and print its address, its value, as well as the ASCII code value of the character.
Example output:
Enter the string (for end press Ctrl+A):
5=2+3^A
5 (01211830)
|2 (01211610)
| |+ (012115D0)
| | |NULL
| | |NULL
| |3 (01211590)
| | |NULL
| | |NULL
|= (012117F0)
| |NULL
| |NULL
Preorder: 5 2 + 3 =
Inorder: + 2 3 5 =
Postorder: + 3 2 = 5
Level order: 5 2 = + 3
The node that has the character with the lowest ASCII code has the address 012115D0, its value is + and its ASCII code is 43.
Press any key to continue ...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started