aspose file tools*
The moose likes Performance and the fly likes Best Data Structure to solve this problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply locked New topic
Author

Best Data Structure to solve this problem

danial leksevo
Greenhorn

Joined: Jun 25, 2011
Posts: 3
Hi All,

Could you please suggest me which data structure is best to use to solve this problem


I have set of int ranges in the form of two dimensional array e.g int[][] array= {{1- 4},{6-10}{8-20},{20- 30},{50-60}};

I want to combining ranges wherever possible to make a range which cover all of sub-set of the ranges e.g {{6-10}{8-20},{20- 30}}={6-30}

and my final set of ranges will be like array= {{1- 4},{6-30},{50-60}}

for this problem, please suggest me which data structure is the best to use. And any idea how I should combine the ranges.

Thanks in advance!


Best
Danial
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Double post, locking.
http://www.coderanch.com/t/543084/java/java/Best-Data-Structure-solve#2464240

luck, db
There are no new questions, but there may be new answers.
 
Consider Paul's rocket mass heater.
 
subject: Best Data Structure to solve this problem
 
Similar Threads
Basic question about a sql select
Best Data Structure to solve this problem
A Hard Puzzle
Sun Cirtification
How would i shuffle my deck of cards?