in C++ language QUESTION 1 Question: a) Draw the BST if the following data is added...
Course: Data Structures A) Draw the Binary Search Tree if the following data is added to a tree in the following order: 40,20, 10, 30, 60, 50, 70, 80. B) How would the tree look like if you remove "40" from the tree? Explain why the tree changes the way you are drawing it.
Data Structures: a. Draw the BST for the following list of integers 100, 50, 200, 40, 80, 150, 300, 30, 45, 70, 90, 140, 160, 250, 400, 60, 10, 55, 52 b. Draw the BST you get when you delete 50 from the BST in “a” above using the inorder successor and list the integers in the correct order c. Draw the BST you get when you delete 200 from the BST in “b” above using the inorder predecessor and...
Consider the following BST: 50 30 70 20 40 60 80 15 35 65 36 64 66 QUESTION 32 child of node Referring to the tree above, the value 62 would be inserted as the (left or right) left or right: node: QUESTION 33 Referring to the original tree above (the exact tree in the picture), which nodes are the predecessor and successor of 50 if 50 was deleted. predecessor: successor: QUESTION 34 Referring to the original tree above (the...
help please!!! In this assignment, we are to make the provided testBST.cpp, an integer BST into a generic template BST to host the following data types: Integer, String, Frac, and FeetInches. #include "Frac.h" #include "FeetInches.h" .... template<class T> void test(vector<T> list); int main() { vector<int> intPattern {3,8,1,4,6,25,15,16}; test(intPattern); vector<string> strPattern { "how", "many", "apples", "did", "you", "buy"}; test(strPattern); } // test Driver template<class T> void test(vector<T> list) { BST<T> *b = new BST<T>; cout << "Insertion sequence for new tree:...
using C language Programming Question 1 Write a C program that takes students marks from a user, one by one until -1" is entered, which would indicate that no other marks are available, and the program terminates. For each mark the program will decide the student grade as: Fail, if mark < 60 • D. if 60<= mark <=70 • C. if 70<=mark <=80 • B. if 80c= mark <=90 • A. if 90cmark <=100 -T -- E - 15203...
WİTH C LANGUAGE Write a program that counts the leaves of a given binary tree. Hint: You will make a small (and smart) update to the add function we discussed in class. a) 125 pointsl Create the following binary trees by creating the nodes (malloc) and setting the related pointers (leftChild, rightChild). Make content random. 60 50 40 60 70 30 45 42 b) 125 points Display the trees on screen the way we did in slide 9 using listAll...
1. Which of the following algorithms requires the most extra space when implemented? A. Quicksort B. Mergesort C. Radix sort D. All use the same amount of extra space 2. Sort this array into ascending order: 80 90 70 85 60 40 50 95. Assume the pivot is 40. (SHOW WORK) A. (40) and (50 60 70 80 85 90 95) B. () and (80 90 70 85 60 50 95) C. () and (50 60 70 80 85 90...
144 Delete Insert PrtSc FS F4 Draw rough sketches in the Lab Report of what the IR, 'H NMR, and 1C NMR spectra would be expected to look like. 4 1. IR bond(s) from the structure below: R Prediction Worksheet (Part B) Molecule 30: IR 100 06 80- 70- 60- 50- 40- 30- C-O 20- C=C 10- T TTT MINTTTTMT 500 4000 1500 1000 3000 2000 wavenumber (cm1) 1H NMR 4 3 2 10 9 8 chemical shift (ppm) 13C...
package hw3; import java.util.LinkedList; /* *********************************************************************** * A simple BST with int keys and no values * * Complete each function below. * Write each function as a separate recursive definition (do not use more than one helper per function). * Depth of root==0. * Height of leaf==0. * Size of empty tree==0. * Height of empty tree=-1. * * TODO: complete the functions in this file. * DO NOT change the Node class. * DO NOT change the name...
In C language (Code Writing 1) The Heat Index is what the temperature feels like in the context of humidity. For example, if the temperature is 90° F and the relative humidity is 70%, then it feels much warmer - closer to 105° F. Here's the formula for computing the Heat Index HI: HI = C1 + c2T + c3R+ TR+C5T + C&R+ czTºR+CTR+ CgTºR? | X where T is the temperature in °F and R is the relative humidity...