Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

write in c not c++ and please add comments to the code You are requested to save all employees information of a certain bank in

write in c not c++
image text in transcribed
image text in transcribed
and please add comments to the code
You are requested to save all employees information of a certain bank in a Binary Search Tree (BST). Write a C program that follows these requirements: 1. Declare a struct Node for the Binary Search Tree. The node should have three fields for the data part: int BankAccount, char EmployeeName[30] and float Balance, and two pointers for the children (left and right). One of the banks accounts should be the AUM- ID of the student and employee name the real name of the student. (5 points] 2. Write a recursive function that inserts nodes in the binary search tree, and use the aacount number as key. [10 points 3. In the main, ask the user how many employees he/she needs to enter, get the data fields, and call the function you wrote in part 2) to insert the nodes to the BST. 15 points) 4. Write 3 functions that print all the information (data fields for all nodes) in the Tree in InOrder, PreOrder and PostOrder. 15 points 5. In the main, call the functions you wrote in part 4. (2.5 points) 6. Write a recursive function that returns the sum of all the balances available at the bank. [10 points) 7. Call this function in the main, then print the sum. [2.5 points) 8. Using the sum you got in part 7), calculate the average balance value and print it (no need to create a function for this). [2.5 points] 9. Write a function that prints the name of the employee with the smallest Account num- ber. (5 points) 10. Write a function that prints the name of the employee with the highest Account number. 15 points) 11. Write a function that prints the Account Number the summation of digits of which is the largest in the BST and prints the result along with the Employee's name. [5 points) 12. Write a function that searches for an account number in the BST and prints a relevant message. The account number is to be given by the user during run-time. [5 points) 13. Print the number of nodes in the Tree by using recursion. [2.5 points) 14. Add randomly (per program execution) the accounts numbers in an array and apply bubble sorting to sort them. Print the result in the console. 17.5 points) 15. Explain theoretically how we would delete a node with two children in a BST and pro- vide a model coding example by providing screenshot of output - it can be either a standalone example or you can apply it on the above exercise. 15 points) 16. Provide a real-world problem that trees are applied. Then provide the correspondent C code. [7.5 points) 17. Design a flowchart that shows all the steps for the above coding question? Explain what is the difference between schematic design and flowchart design? [15 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions