Consider the following data 6, 10, 3, 8, 20, 1, 5, 7 a. (5 pts) Step-by-step...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following data 6, 10, 3, 8, 20, 1, 5, 7 a. (5 pts) Step-by-step form a Binary Search Tree (BST) for the above data. What is the depth of the BST? b. (5 pts) Implement the following operations on BST in the given se- quence: • Insert data 15 to the BST. What is the time complexity of inser- tion? • Remove data 10 to the BST. What is the time complexity of dele- tion? Search for data 15 in the BST. What is the time complexity of search? c. (5 pts) Step-by-step form a minimum Binary Heap (BH) for the same data. What is the depth of the BH? d. (5 pts) Implement the following operations on BH in the given sequence: Search for the minimum in the BH. What is the time complexity of the minimum search? • Remove the minimum from the BH. What is the time complexity of deletion? • Update data 20 to 2 in the BH. What is the time complexity of update? Consider the following data 6, 10, 3, 8, 20, 1, 5, 7 a. (5 pts) Step-by-step form a Binary Search Tree (BST) for the above data. What is the depth of the BST? b. (5 pts) Implement the following operations on BST in the given se- quence: • Insert data 15 to the BST. What is the time complexity of inser- tion? • Remove data 10 to the BST. What is the time complexity of dele- tion? Search for data 15 in the BST. What is the time complexity of search? c. (5 pts) Step-by-step form a minimum Binary Heap (BH) for the same data. What is the depth of the BH? d. (5 pts) Implement the following operations on BH in the given sequence: Search for the minimum in the BH. What is the time complexity of the minimum search? • Remove the minimum from the BH. What is the time complexity of deletion? • Update data 20 to 2 in the BH. What is the time complexity of update?
Expert Answer:
Related Book For
Introduction to Data Mining
ISBN: 978-0321321367
1st edition
Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Consider the following data on full-service restaurant sales. Calculate both the three-month and five-month moving averages for these data, and compare the forecasts by calculating the...
-
Complete the given table. Number of Days Outstanding Accounts Receivable Estimated % Uncollectible Total Estimated Uncollected Accounts 045 days $ 752,000 2 % $enter a dollar amount 4690 days 255,000...
-
Two trucks drive directly away from one another on a straight line, as indicated in FIGURE 9-37. The trucks drive with their speeds adjusted precisely so that the center of mass (CM) of the two...
-
The file Lawdata.xlsx gives the LSAT scores and law school GPAs for 15 law-school students. Based on this data, you are 95 percent sure the correlation between LSAT score and GPA is between which two...
-
Sketch how you would arrange four 3-in.-wide by 12-in.long thin but rigid strips of sheet metal on a hub to create a windmill like the one. Discuss, with the help of velocity triangles, how you would...
-
After-Tax Cost of Debt LL Incorporateds currently outstanding 11% coupon bonds have a yield to maturity of 8%. LL believes it could issue at per new bonds that would provide a similar yield to...
-
1. What are cost-volume-profit analysis underlying assumptions and what would you do if assumptions are not met? 2. Do research and discuss cost behavior analysis from the company that you work for...
-
You talk to Sally about getting paid for the work you're doing. You suggest $25 an hour and she agrees. You are only doing this temporarily since you have some extra time so you set yourself up as a...
-
Evaluate the triple integral in cylindrical coordinates for the volume inside the cylinder x2 + y2 = 9 and between z= 3x2+ 4v and the xy- plane. O A. 28 TI Cubic units O B. 24 TI cubic units O C. 26...
-
AHP Company generated $200 million sales last year, incurred $110 million in cost of goods sold and incurred $50 million in SG&A expenses including depreciation expense of $15 million. During the...
-
It is a criminal offence to issue a dud cheque in Ghana. 1. On the basis of your knowledge in finance and banking, describe briefly the main reason for the criminalisation of the act of issuing dud...
-
At the beginning of July, Fick 3D Corporation has a balance in inventory of $2,950 of 3D printing accessories. The following transactions occur during the month of July. July 3 July 4 July 9 Purchase...
-
The future cash flows of two mutually exclusive capital projects follow: Project A: Uneven Flow Year0123 Cash Flow(-$12,000)$6,500$10,500$6,000 Project B: Annuity Flow Year0123456**Annuity** Cash...
-
Greta died on September 1 0 , 2 0 2 2 . She has never carried on a business. By what date must her final income tax return be filed? Question 5 options: April 3 0 , 2 0 2 3 . April 3 0 , 2 0 2 4 ....
-
Selected account balances of Varsity Company on December 31, 20x4, are reflected below: 5% Preferred stock, $100 par $ 50,000 Common stock, $10 par 100,000 Paid-in capital in excess of par-Preferred...
-
True & False The basis of an asset must be reduced by the depreciation allowable, 2. Adjusted gross income (AGI) is the basis for a number of phase-outs of deductions. 3. A change to adjusted gross...
-
Repeat the analysis shown in Example 5.3 for finding the location of a decision boundary using the following information: (a) The prior probabilities are P(Crocodile) = 2 P(Alligator). (b) The prior...
-
Discuss why a document-term matrix is an example of a data set that has asymmetric discrete or asymmetric continuous features.
-
(a) For each of the sequences w = given below, determine whether they are subsequences of the sequence Table 7.15. Example of event sequences generated by various sensors (b) Determine whether each...
-
Apple stock is selling for \($120\) per share. Call options with a \($117\) exercise price are priced at \($12.\) What is the intrinsic value of the option, and what is the time value?
-
Ibrahim bought 200 shares of a stock trading in the Abu Dhabi Securities Exchange at AED 12 (United Arab Emirates dirham) per share. Over time, the price of the stock increased to AED 18 per share....
-
Twitter is trading at \($34.50.\) Call options with a strike price of \($35\) are priced at \($2.30\) . What is the intrinsic value of the option, and what is the time value?
Study smarter with the SolutionInn App