CSC 3102 Chapter : 3102 Hw2

13 views1 pages
15 Mar 2019
School
Course
Professor

Document Summary

Due october 7, 2014 (in class: (20 points) your friend, john (whoever he is! ), gives you an array b[1n] of numbers. He wants to obtain the smallest k numbers in b, in sorted order. One way to solve this is: sort b and the output the k smallest numbers. Show that height of such an avl tree having n nodes is. O(log n): (10+10+20 = 40 points) range queries. Given an avl tree show (using pseudocode) how to support the following queries: Rangecount(k1, k2): count the number of keys in the avl tree which are between k1 and k2 in o(log n) time (hint: recall the size eld). Rangereport(k1, k2): list all the keys in avl tree which are in between k1 and k2 in. Rangemin(k1, k2): consider the eld data stored in each node to be an integer. Find the key with minimum data values among all the keys which are between k1 and k2 in.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents