Đang Thực Hiện

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.

Kỹ năng: Java

Xem thêm: deletion binary search tree, binary search tree inorder, binary search tree deletion

Về Bên Thuê:
( 46 nhận xét ) Toronto, Canada

Mã Dự Án: #14861142

Đã trao cho:

$50 CAD trong 1 ngày
(319 Đánh Giá)
6.4

17 freelancer đang chào giá trung bình $149 cho công việc này

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 Thêm

$150 CAD trong 3 ngày
(70 Đánh Giá)
5.4
$140 CAD trong 3 ngày
(29 Đánh Giá)
4.8
$155 CAD trong 3 ngày
(6 Đánh Giá)
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 Thêm

$80 CAD trong 3 ngày
(20 Đánh Giá)
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 Thêm

$66 CAD trong 10 ngày
(9 Đánh Giá)
3.4
BeshoyMousaKhair

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

$100 CAD trong 3 ngày
(13 Đánh Giá)
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 Thêm

$200 CAD trong 4 ngày
(10 Đánh Giá)
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 Thêm

$133 CAD trong 4 ngày
(1 Đánh Giá)
0.5
$155 CAD trong 3 ngày
(0 Đánh Giá)
0.0
$333 CAD trong 1 ngày
(0 Đánh Giá)
0.0
$155 CAD trong 3 ngày
(0 Đánh Giá)
0.0
$200 CAD trong 3 ngày
(0 Đánh Giá)
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 Thêm

$111 CAD trong 3 ngày
(0 Đánh Giá)
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 Thêm

$220 CAD trong 1 ngày
(0 Đánh Giá)
0.0
$133 CAD trong 4 ngày
(0 Đánh Giá)
0.0
CGuzmanP

I've worked with binary trees before, and had similar assignments, so I already have code to start with. My code is clean and easy to read, so you'll have no problems understanding it. Relevant Skills and Experience I Thêm

$150 CAD trong 3 ngày
(0 Đánh Giá)
0.0