Computers and Technology
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)

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:30, megkate
Complete the sentence based on your knowledge of the professional difficulties faced by music artists. digital technology allows audiences to see free live telecasts of music or dance performances through
Answers: 1
image
Computers and Technology, 23.06.2019 21:20, nicki76
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
image
Computers and Technology, 24.06.2019 07:50, treytonmesser
Write a defining table and then a program that determines if you can sleep in or not. your program should get all its input from your computer’s clock. on all weekdays (monday through friday) that are not holidays, your program should output “get up! ” on all other days (weekends and holidays), your program should output “sleep in.” the three holidays that your program must check for are january 1 (new year’s day), july 4 (u. s. independence day), and december 25 (christmas). you don’t need to include other holidays in your program because most other holidays do not occur on a fixed day each year.
Answers: 1
image
Computers and Technology, 24.06.2019 10:00, noahmace
When writing a business letter, how many times can you use the same merge field in a document? once once, unless using the address block feature unlimited it will depend on the type of document you choose
Answers: 1
Do you know the correct answer?
Write a program to create a binary search tree where each node has a counter to store how many times...

Questions in other subjects:

Konu
English, 29.08.2021 01:00