Question
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
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 Find(n/2) 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) Find(n/2) which improve over the Find(k) approach.
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. (If your structures/algorithms are based on standard structures/algorithms, emphasize in what way yours are different. Do not repeat everything!)
3. On-line median we dacussed the on-line -largest problem We solved it, using an augmented AVLtee structure, with the follewing characteristics Insernix) in time and space O(logsn) where n is the number of elements in the structure at this time G. c the mumber of Insest operations, mnus the namber ef Delete operations, up until now) Deletels) in time and space Oflogt) where n is the number of eleesents in the structure st this time (r e, the number of Insert operstions, minus the num irme fi e, the number of Insert operations, minus the umber of Delete operations up until now) Supposxe the insted of doing the Findl) operation, with k n arbitrary positive integer the csn vary from of Delete operations, up until now) log-n) and space 0(1) where n is the nurmber of elenents in the structure at this operatson, w one Find to the next, we replace it by Find n/2b where n is the number of all eicments that are currently stored in the structure Can you devise a data structure and sigorithms for Incit) Deletelx) which improve over the Find(k) approsch discussed in class (Otviously, that ipproach will still apply, so we know that all three operations certain for you to solve is: Can you do beter?) Assume you have s Insert and Delete operations and t Find eperations, note thats and t are independent Carefully formuiace your deta structure, auline the ree algonthms in some detail, and determine with care the time and space complexities of yoar theee algorithms Pin your complexity analysis, pay attention to the constants thet usually are hidden in the order-of notation ns ean certainly be done in time and space OKlogan). however, the questica 3. On-line median we dacussed the on-line -largest problem We solved it, using an augmented AVLtee structure, with the follewing characteristics Insernix) in time and space O(logsn) where n is the number of elements in the structure at this time G. c the mumber of Insest operations, mnus the namber ef Delete operations, up until now) Deletels) in time and space Oflogt) where n is the number of eleesents in the structure st this time (r e, the number of Insert operstions, minus the num irme fi e, the number of Insert operations, minus the umber of Delete operations up until now) Supposxe the insted of doing the Findl) operation, with k n arbitrary positive integer the csn vary from of Delete operations, up until now) log-n) and space 0(1) where n is the nurmber of elenents in the structure at this operatson, w one Find to the next, we replace it by Find n/2b where n is the number of all eicments that are currently stored in the structure Can you devise a data structure and sigorithms for Incit) Deletelx) which improve over the Find(k) approsch discussed in class (Otviously, that ipproach will still apply, so we know that all three operations certain for you to solve is: Can you do beter?) Assume you have s Insert and Delete operations and t Find eperations, note thats and t are independent Carefully formuiace your deta structure, auline the ree algonthms in some detail, and determine with care the time and space complexities of yoar theee algorithms Pin your complexity analysis, pay attention to the constants thet usually are hidden in the order-of notation ns ean certainly be done in time and space OKlogan). however, the questicaStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started