title: best data structure suitable for event-calender application
body: <p>I have a class which represents an event.
  so we can create an event by creating a object of this class. constructor takes <code>description, start time, end time, list of invites, location</code> and return an id for uniquely identifying this object. </p>
  
  <pre><code>Create events : (description, start time, end time, list of invites, location) -&gt; id
  </code></pre>
  
  <p>Now this class has another method which takes an id and return a corresponding event object</p>
  
  <p><code>Get event by id : id -&gt; event object</code></p>
  
  <p>similarly we can update an event</p>
  
  <p><code>Update event -&gt; description, start time, end time</code></p>
  
  <p>now 4th operation we want to do is that we want to filter out all the events between a time range </p>
  
  <p><code>get event : start time, end time</code></p>
  
  <p>Now I have to use/design a data structure which can perform these 4 operations efficiently. (I mean we are now allowed to use File storage or Caching technologies)</p>
  
  <p>for 1st three operations I thought I can use Has map/table which will be having <code>id</code> as a key and object as a value.
  but in this case I wont be able to perform 4th operation efficiently.</p>
  
  <p>for that again I though I could use <code>trie</code> data structure.</p>
  
  <pre><code>Root Node-&gt;
        Month nodes (12 nodes)
        each month node will be having 30(or 31/28) children nodes. 
        and then those children nodes will be having time stamp nodes.
  </code></pre>
  
  <p>but in this case 1st three operations become bit inefficient.</p>
  
  <p>How can I combine these two data structure to solve this problem and perform all 4 operations efficient.  or is there any better data structure which can do this task. or we have to create our own custom data structure?</p>