# Building a Binary Search Tree

Building a Binary Search Tree

In this assignment you will be implementing a binary search tree. You must use a linked-list (i.e. reference-based) to implement the tree. Each node in your tree should hold a character. Each node will also contain an integer called count. Include the following functions/methods for the BST tree:

.

Insert Insert an item into the binary search tree. Be sure to keep the binary search tree properties. When an item is first inserted into the tree the count should be set to 1. When adding a duplicate character, rather than adding another node, the count variable should just be incremented. You should insert in a case-insensitive manner. In other words, the letter 'a' and the letter 'A' would be considered as the same letter.

Search Write a recursive function that searches for a character in the binary search tree. It should return a pointer to the node in which it is found or it should return NULL if the character is not in the tree. Again, this should be case-insensitive.

FindMin Find and return the smallest character (the one with the smallest ASCII value) in the tree.

FindMax Find and return the largest character (the one with the largest ASCII value) in the tree.

Height Compute and return the height of a particular subtree. This function should take a pointer to a node and return the height of the subtree using the specified node as the root. Thus, if the root was passed to this function, the value returned would be the height of the entire tree.

Remove Remove a node from the tree. Be sure to maintain all binary search tree properties. If removing a node with a count greater than 1, just decrement the count.

Print Print the tree in the following manners. When printing a node, print the character followed by the count in parentheses. For example, c(2), k(1).

Preorder Traverse and print the tree in preorder notation. Write this function recursively.

Inorder Traverse and print the tree in inorder notation. Write this function recursively.

Postorder Traverse and print the tree in postorder notation. Write this function recursively.

Your program should perform the following steps:

1. Prompt the user for the name of the file (a string). Use the string input by the user as an argument to open file:

2. Open the file on disk, and process its contents, adding characters to the BST and

increasing the counts of existing characters if necessary

3. Repeat steps 1&2 until the user enters some sentinel value.

4. Print the BST tree

5. Print the minimum character and maximum character in the BST.

6. Prompt the user for the character he wants to search and perform searching, print the result

7. Prompt the user for one character to be removed, and then print the BST tree after deletion.

Taidot: Java

( 49 reviews ) Toronto, Canada

Projektin tunnus: #14861142

(319 arvostelua)
6.4

## 17 freelanceria on tarjonnut keskimäärin 149 \$ tähän työhön

liangjongai

Hi! I'm interesting your project very well. I am mastering Java and I'm a good Mathematician. And also I have many knowledge and experience about BTree. Let's go ahead with me Stay tuned, I'm still working on this p Lisää

(70 arvostelua)
5.4
(29 arvostelua)
4.8
(6 arvostelua)
4.3
anhnh23

Hi, I have a bachelor’s degree in Computer Science & I have 5+ years in Java; Solving problem and optimizing system are my passion. Satisfied customers is my key strategy. Relevant Skills and Experience Object-oriente Lisää

(20 arvostelua)
3.9
younjess

hi , i worked on pass about these kind of problems, i'm able to finished it on few time , but to don't be under much pressure i preferer 3 days or so , no problems we can talk about that if you want . Relevant Skills Lisää

(9 arvostelua)
3.4
BeshoyMousaKhair

. Relevant Skills and Experience . Proposed Milestones \$100 CAD - .

(13 arvostelua)
3.5
ShakaibArsalan7

Hey an experience java developer is here and got experience of two year and got good knowledge of java fundamental and OOP so feel free to contact me over chat to discuss further Regards Relevant Skills and Experience Lisää

(10 arvostelua)
3.1
alhassanlatif

Hello, I will build your BST in Java I have studied it and use this data structure many times. Relevant Skills and Experience I have experience in Java for more than 5 years and built many projects using it also I pa Lisää

(1 arvostelu)
0.5
(0 arvostelua)
0.0
(0 arvostelua)
0.0
(0 arvostelua)
0.0
(0 arvostelua)
0.0
dharmjitsingh

I have placed a bid on this project as I have already implemented many ADT of data structures in Java Relevant Skills and Experience Java/Data Structures and algorithms Proposed Milestones \$111 CAD - one time deliver Lisää

(0 arvostelua)
0.0
jomingeorge94

Hi, I am web developer experienced in designing and developing websites for my own projects as well as for clients. I have just graduated from Newcastle University studying Bsc Computer Science. I have seen your pos Lisää