Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a BST class that implements a binary search tree, Suppose the keys are inserted into a binary search tree in this order. 55,63,31,17,22,40,24

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

1. Write a BST class that implements a binary search tree, Suppose the keys are inserted into a binary search tree in this order. 55,63,31,17,22,40,24 a. Draw the tree b. The class should include functions that perform the following tree traversal strategies: i. pre-order traversal ii. post-order traversal iii. in order traversal 2. Assume you are building a database using linked lists for the school football team. People are constantly being enrolled and dropped out of the team. Your job is to keep track of the players. The players can be identified by their assigned 3-digit number (eg. 759, 412). Build a system using the most appropriate data structure following the sample output. Sample output: Inserted! Inserted! Inserted! Number of players: 3 No.: 596, 132, 328 Dropped! Number of players: 2 No.: 132, 328 3. Write a class for a Last in, First out data structure using arrays. The structure should contain the following names: {"Ahmad, Sarah, Afifi, Jamal, Kamal, Amina", "Nur", "Iqmal"} a. The class should include functions that performs the following i. Insertion of a new name where a new name is added to the data structure. ii. Removal of a name where a name is removed from the data structure. iii. Displays all the names present in the data structure. 4. Write a program that stores 5 integers in an array. a. Display the elements of the array and their respective addresses using pointers. Your output should look like this: Integer 1 : x Integer 2: x Integer 3 : x Integer 4: x Integer 5 : x Elements in array are: Element 1 contains the value x and is located at y Element 2 contains the value x and is located at y Element 3 contains the value x and is located at y Element 4 contains the value x and is located aty 5. Write a binary tree class that implements a binary tree of float objects to record the following structure. 7.5-5.3, 8.2 5.3-2.9, 9.7 8.2 - 22.2, 9.5 a. The class should include a function that performs a in order tree traversal

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

Question

How Lean was the Organization? How Lean was the Organization

Answered: 1 week ago

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago