Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to prove a lower bound logn for a data structure?
    primarykey
    data
    text
    <p>I have a homework question as follows (note that I am not looking for exact answers, just looking for simple suggestions to move on). </p> <blockquote> <p>S is a data structure which supports Insert(x,S), Delete(x, S) and Find_Smallest_Item(S) in time &lt;= T(n). Prove a lower bound for T(n) such as Ω(logn).</p> </blockquote> <p>Here is my thoughts so far:</p> <p>I guess I need to find a reduction where I will reduce this problem into an easier one, and prove it cannot be lower than logn. I read many tutorials about lower bounds and most of them reduced a problem into sorting, then they used sorting as a black box and proved the algorithm cannot be lower than nlogn.</p> <p>But here, we are dealing with logn and I don't know such an algorithm to reduce to. Maybe it's gotta do something with the depth of a tree structure, logn. But I couldn't figure out where to start.</p> <p>Can you suggest me some hints? </p> <p><strong>Edit</strong>: Actually something came to my mind but I don't know if I am supposed to prove a lower bound with a trick like that. So, I assume I have insert, delete and find_smallest operations, each of them has a logn time complexity.</p> <p>For example, to construct a sorted list, I can use delete and find_smallest functions, e.g. I can run find_smallest for the first time, and after finding the smallest element in the list, then I will delete the element. I will run it once again and therefore I will find 2nd smallest element, and so on. </p> <p>Therefore, I can implement sorting by using deletion and find_smallest functions. So if I continue doing this n times, each of them will take logn (for deletion) + logn (for finding smallest), so in overall, sorting will take nlogn.</p> <p>I don't know how to tweak this for insertion, though.</p> <p><strong>Edit 2:</strong> In order to use insertion for the proof: after finding the ith smallest element in the list, what if I insert it to ith place? e.g. after finding 3rd smallest element with the procedure above, I can insert it to 3rd index of the data structure. Therefore, at the end I will obtain a sorted data structure.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload