Click here to Skip to main content
15,893,588 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: My brain hurts: overlapping range lists Pin
Gerry Schmitz30-Dec-21 10:05
mveGerry Schmitz30-Dec-21 10:05 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:14
mvahoney the codewitch30-Dec-21 11:14 
GeneralRe: My brain hurts: overlapping range lists Pin
0x01AA30-Dec-21 11:20
mve0x01AA30-Dec-21 11:20 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:37
mvahoney the codewitch30-Dec-21 11:37 
GeneralRe: My brain hurts: overlapping range lists Pin
Gerry Schmitz30-Dec-21 19:06
mveGerry Schmitz30-Dec-21 19:06 
GeneralRe: My brain hurts: overlapping range lists Pin
Randor 30-Dec-21 11:49
professional Randor 30-Dec-21 11:49 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 12:05
mvahoney the codewitch30-Dec-21 12:05 
GeneralRe: My brain hurts: overlapping range lists Pin
englebart1-Jan-22 9:11
professionalenglebart1-Jan-22 9:11 
Ignore the wrinkle. Instead of trying to ever merge, split into smaller ranges in case of overlap. Exception is if new entry is totally encompassed by existing entry in which case new entry is discarded.

It is only safe to merge if there is not another To that conflicts with that range. For each new entry’s overlap with an existing entry, split both new and existing into matched smaller ranges.

This is classic “bin” (as in bucket) data structure problem with your twist.

[1,5]A
[1,5]B

Insert [3,7]A

[1,3]A
[1,3]B
[3,5]A
[3,5]B
[5,7]A

Or adding another level where the range holds a list which it sounds like you want to avoid.

[1,3] [A,B]
[3,5] [A,B]
[5,7] [A]

Good luck!

JokeWhat spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
oofalladeez34330-Dec-21 7:49
professionaloofalladeez34330-Dec-21 7:49 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
OriginalGriff30-Dec-21 8:38
mveOriginalGriff30-Dec-21 8:38 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
oofalladeez34330-Dec-21 9:43
professionaloofalladeez34330-Dec-21 9:43 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
OriginalGriff30-Dec-21 9:51
mveOriginalGriff30-Dec-21 9:51 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
oofalladeez34330-Dec-21 10:20
professionaloofalladeez34330-Dec-21 10:20 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
oofalladeez34331-Dec-21 17:54
professionaloofalladeez34331-Dec-21 17:54 
QuestionWhat is the funniest TV Commercial? They can be real or fake... Pin
oofalladeez34330-Dec-21 7:19
professionaloofalladeez34330-Dec-21 7:19 
AnswerRe: What is the funniest TV Commercial? They can be real or fake... Pin
Kschuler30-Dec-21 8:34
Kschuler30-Dec-21 8:34 
GeneralHaha! I have my internet back! Pin
OriginalGriff30-Dec-21 1:34
mveOriginalGriff30-Dec-21 1:34 
GeneralRe: Haha! I have my internet back! Pin
User 49097430-Dec-21 1:39
User 49097430-Dec-21 1:39 
GeneralRe: Haha! I have my internet back! Pin
Slacker00730-Dec-21 2:01
professionalSlacker00730-Dec-21 2:01 
GeneralRe: Haha! I have my internet back! Pin
User 49097430-Dec-21 2:16
User 49097430-Dec-21 2:16 
GeneralRe: Haha! I have my internet back! Pin
OriginalGriff30-Dec-21 2:17
mveOriginalGriff30-Dec-21 2:17 
GeneralRe: Haha! I have my internet back! Pin
User 49097430-Dec-21 2:21
User 49097430-Dec-21 2:21 
GeneralRe: Haha! I have my internet back! Pin
OriginalGriff30-Dec-21 2:28
mveOriginalGriff30-Dec-21 2:28 
GeneralRe: Haha! I have my internet back! Pin
User 49097430-Dec-21 2:48
User 49097430-Dec-21 2:48 
GeneralRe: Haha! I have my internet back! Pin
dandy7230-Dec-21 2:49
dandy7230-Dec-21 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.