Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Efficient algorithm needed to split Set::IntSpan objects

by vitoco (Friar)
on Sep 23, 2009 at 14:46 UTC ( #796989=note: print w/replies, xml ) Need Help??


in reply to Efficient algorithm needed to split Set::IntSpan objects

c1 is overlapping b and a2 ranges.

How many keys do you expect the hash to have?

This approach could be difficult to handle... If you want to add many spans, you will end with many rows with only one X for each span.

Also, if you want to add more than 9 spans with an X in the same position, the result string won't be enough.

  • Comment on Re: Efficient algorithm needed to split Set::IntSpan objects

Replies are listed 'Best First'.
Re^2: Efficient algorithm needed to split Set::IntSpan objects
by ikegami (Pope) on Sep 23, 2009 at 15:21 UTC

    Also, if you want to add more than 9 spans with an X in the same position, the result string won't be enough.

    Easily fixed by using chr($x) instead of $x. That will allow 2^32 overlaps. Maybe even 2^64 on 64-bit systems. You might have to turn off some unicode warning.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://796989]
help
Chatterbox?
[Discipulus]: morning marto!

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-02-22 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (325 votes). Check out past polls.