Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. On-line median class. we dscussed the on-line kth-largest problem. We solved it, using an augmented AVL-tree structure. with the following characteristics: Insert(x) in time

image text in transcribed

2. On-line median class. we dscussed the on-line kth-largest problem. We solved it, using an augmented AVL-tree structure. with the following characteristics: Insert(x) in time and space O(log2n) where n is the number of elements in the structure at this time (i e. the number of Insert operations, minus the number of Delete operations, up until now) Delete(x) in time and space O(log2n) where n is the number of elements in the structure at this time (i e. the number of Insert operations, minus the number of Delete operations, up until now) Find(k)in time O(log:n) and space O(1) where n is the number of elements in the structure at this time i e, the number of Insert operations, minus the number of Delete operations, up until now) Suppose that instead of doing the Find(k) operation, with k an arbitrary positive integer that can vary from one Find to the next, we replace it by Findo n3b) where n is the number of all elements that are currently stored in the structure. Can you devise a data structure and algorithms for Insert(x) Delete(x) Finds nfsb) which improve over the Find(k) approach discussed in class. (Obviously, that approach w sll apply, so we know that all three operations can certainly be done in time and space O(log2n); however, the question for you to solve is: Can you do better??). Carefully formulate your data structure, outline the three algorithms in some detail, and determine with care the time and space complexities of your three algorithms algorithms da ures/algorithms emphasiz urs are different. Do not repeat everythig 2. On-line median class. we dscussed the on-line kth-largest problem. We solved it, using an augmented AVL-tree structure. with the following characteristics: Insert(x) in time and space O(log2n) where n is the number of elements in the structure at this time (i e. the number of Insert operations, minus the number of Delete operations, up until now) Delete(x) in time and space O(log2n) where n is the number of elements in the structure at this time (i e. the number of Insert operations, minus the number of Delete operations, up until now) Find(k)in time O(log:n) and space O(1) where n is the number of elements in the structure at this time i e, the number of Insert operations, minus the number of Delete operations, up until now) Suppose that instead of doing the Find(k) operation, with k an arbitrary positive integer that can vary from one Find to the next, we replace it by Findo n3b) where n is the number of all elements that are currently stored in the structure. Can you devise a data structure and algorithms for Insert(x) Delete(x) Finds nfsb) which improve over the Find(k) approach discussed in class. (Obviously, that approach w sll apply, so we know that all three operations can certainly be done in time and space O(log2n); however, the question for you to solve is: Can you do better??). Carefully formulate your data structure, outline the three algorithms in some detail, and determine with care the time and space complexities of your three algorithms algorithms da ures/algorithms emphasiz urs are different. Do not repeat everythig

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions