Question

Given the list of values below, create a Binary Search Tree for the list, Use the first value in the list as the root of the tree, add the nodes to BST in the order they appear in the list.[50, 44, 82, 39, 35, 98, 87, 100, 74, 23, 34, 14, 94]

What is the minimum height of a Binary Tree that contains 24nodes?

What is the minimum height of a Binary Tree that contains 64nodes?

What is the minimum height of a Binary Tree that contains 7nodes?

What is the minimum height of a Binary Tree that contains 243nodes?

What is the minimum height of a Binary Tree that contains 1020nodes?

Answer #1

For Calculating the minimum number of height of the binary tree
the formula is **ceil of (Height = log _{2}(N+ 1)-1
)**

For 24 nodes ===> **height = 4**

For 64 nodes ===> **height = 5**

For 7 nodes ====> **height = 2**

For 243 nodes ===> **height = 7**

For 1020 nodes ===> **height = 9**

Construct a Binary Search Tree using the following
data: (5 pts)
54
37
47
28
44
71
40
60
(Make sure to show dummy nodes)
b) Illustrate how will you search for V = 39 from the
above tree and how many searches will be needed. (5
pts)
c) Illustrate how you will delete the root from the
above tree, redraw the tree after deletion. (5 pts). Redraw the
tree.

Create an add method for the BST (Binary Search Tree) class.
add(self, new_value: object) -> None:
"""This method adds new value to the tree, maintaining BST
property. Duplicates must be allowed and placed in the right
subtree."""
Example #1: tree = BST()
print(tree) tree.add(10)
tree.add(15)
tree.add(5)
print(tree)
tree.add(15)
tree.add(15)
print(tree)
tree.add(5)
print(tree)
Output:
TREE in order { }
TREE in order { 5, 10, 15 }
TREE in order { 5, 10, 15, 15, 15 }
TREE in order {...

In this lab, you will write a program that creates a binary
search tree based on user input. Then, the user will indicate what
order to print the values in. **Please write in C code**
Start with the bst.h and bst.c base code provided to you. You
will need to modify the source and header file to complete this
lab.
bst.h:
#ifndef BST_H
#define BST_H
typedef struct BSTNode
{
int value;
struct BSTNode* left;
struct BSTNode* right;
} BSTNode;
BSTNode*...

Question 2:
Write a C program that read 100 integers from the attached file
(integers.txt) into an array and copy the integers from the array
into a Binary Search Tree (BST). The program prints out the
following:
The number of comparisons made to search for a given integer in the
BST
And
The number of comparisons made to search for the same integer in
the array
Question 3
Run the program developed in Question 2 ten times. The given values...

The Binary Search Tree implementation for bst.zip. The code in
the destructor of the BST class is empty. Complete the destructor
so the memory allocated for each node in the BST is freed. Make a
couple of different trees in your main method or in a function to
test the destructor (the program should not crash upon
exiting).
bst.zip (includes the following files below in
c++):
bst.h:
#pragma once
#include
#include "node.cpp"
using namespace std;
template
class BST
{
public:...

have a java application need to create an application which is
able to do some analysis on temperature data stored in a data file.
You will be given the “temperatures.dat” data file which contains
the data you must analyze. The analysis you’ll need to do is:
Total number of data points
Find coldest temperature
Find warmest temperature
Find average temperature
Find the frequency of each temperature
Find the most frequent temperature
Find the least frequent temperature
All classes must be...

import java.util.ArrayList;
/*
Rules:
1. Allow Tester to iterate
through all nodes using the in-order traversal as the
default.
This
means, in Tester the following code should work for an instance of
this class
called bst
that is storing Student objects for the data:
BinarySearchTree_Lab08<String> bst = new
BinarySearchTree_Lab08<String>();
bst.add("Man");
bst.add("Soda"); bst.add("Flag");
bst.add("Home");
bst.add("Today"); bst.add("Jack");
...

Student Grades
Student
Test
Grade
1
76
62
2
84
90
3
79
68
4
88
84
5
76
58
6
66
79
7
75
73
8
94
93
9
66
65
10
92
86
11
80
53
12
87
83
13
86
49
14
63
72
15
92
87
16
75
89
17
69
81
18
92
94
19
79
78
20
60
71
21
68
84
22
71
74
23
61
74
24
68
54
25
76
97...

Pinky and The Brain are great friends. They like to play games
with numbers. This time, Pinky has given The Brain a list of
numbers and given him the task of determining if it is possible to
choose a subset of them such that they sum is equal to another
given number.
Build an algorithm using dynamic programming to help The Brain
with his problem.
INPUT
The first line corresponds to N, the amount of numbers given by
Pinky
The...

Using the accompanying Student Grades data, construct a scatter
chart for midterm versus final exam grades and add a linear
trendline. What is the model? If a student scores 7878 on the
midterm, what would you predict her grade on the final exam to
be?
Student
Midterm
Final Exam
1
75
64
2
85
91
3
80
68
4
88
83
5
76
60
6
67
80
7
78
74
8
95
94
9
67
61
10
93
87
11...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 21 minutes ago

asked 40 minutes ago

asked 42 minutes ago

asked 46 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago

asked 3 hours ago