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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!