×

# Need help in set.

 0 Given a set of pairs. Each pair represent a range of numbers. Example : (5, 8) represents {5, 6, 7, 8}. I want to find in which pair an element x is present, it is sure that element x exits in at least one pair? Can this be solved in logarithmic time? Thanks in advance! asked 28 Jan '18, 05:02 62●3 accept rate: 0% is there are overlapping pairs? (28 Jan '18, 23:15) pk3012★ Sort, join overlapping pairs, binary search. (28 Jan '18, 23:31) 1 Can you please paste the exact link of question? It will help us to sort out weather it is genuine question or it is not taken from any ongoing contest. (29 Jan '18, 14:45)

 0 There must be some other constraints too else this would be a very easy problem.Just take min and max value of the set.That would be your answer. answered 28 Jan '18, 08:58 1 accept rate: 0% "Can this be solved in logarithmic time?" This is the constraint I guess. (28 Jan '18, 09:14)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×2,739
×163
×12

question asked: 28 Jan '18, 05:02

question was seen: 207 times

last updated: 29 Jan '18, 14:45