Finding elements in segments

Revision en1, by gsmcoder97, 2016-07-22 16:05:07

I have been solving some problems recently and they tend to have the following query at the end:

Given n segments a1,a2 
                 b1,b2
                 .
                 .
                 .
And some numbers of an array x1, x2, x3, . . . 

I want to find the segments in which each of these numbers appear. There might be more than one segment so I want all the segments in which they appear.

How do I approach this question?

Thank you.

Tags segments, array

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gsmcoder97 2016-07-22 16:05:07 509 Initial revision (published)