subject
Computers and Technology, 12.04.2021 21:00 BigCra

Write a program to create a binary search tree where each node has a counter to store how many times its value occurs in the tree, and then prints the pre-order, in-order and post-order transversals of the modified tree. The values that occur more than once are followed with their quantity noted in parenthesis. Input from the keyboard a single line of integer numbers separated by spaces. Assume proper input and no more than 30 values. Output to the screen the pre order, in order, and post order traversals on separate lines. Quantities larger than one are denoted with parenthesis. Each row must be properly labeled and use a minimum of one space between each number. Use a tree data structure. Refer to the sample output below. Sample Run:

Enter up to 30 integer values: 7 1 5 7 4 4 1 8 9 7 1 4 2 2 3 5 6 7 12 14 11 12
Pre Order: 7(4) 1(3) 5(2) 4(3) 2(2) 3 6 8 9 12(2) 11 14
In Order: 1(3) 2(2) 3 4(3) 5(2) 6 7(4) 8 9 11 12(2) 14
Post Order: 3 2(2) 4(3) 6 5(2) 1(3) 11 14 12(2) 9 8 7(4)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:20
In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server or network availability confidentiality integrity identity automated attack software? those who wrongfully disclose individually identifiable health information can be fined up to what amount per calendar year? single most expensive malicious attack hipaa what are script kiddies? advanced persistent threat security manager security engineer what level of security access should a computer user have to do their job what process describes using technology as a basis for controlling the access and usage of sensitive data? cybercriminal
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
question
Computers and Technology, 23.06.2019 15:20
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
You know the right answer?
Write a program to create a binary search tree where each node has a counter to store how many times...
Questions