Results 1 to 2 of 2
- 04-14-2014, 01:56 AM #1Member
- Join Date
- Sep 2012
- Rep Power
Converting a Set into a Range Statement and Vice Versa.
I have a Set S=[1,2,3,4,5,10,12]
Now I want to convert this Set into a Range Statement which is of Form as follows...
Desired Range Statement Form is = 1..5\/10\/12.
Since 1 to 5 are contigious in my Set, they are represented as 1..5 and 10 and 12 are single non contigious elements they are given a single element with a union (\/) Symbol.
Similarly, I want to convert the RangeStatement 1..5\/10\/12 to Set S=[1,2,3,4,5,10,12].
DO we have any efficient method to o this in Java?
if I need to write my own method or is there any inbuilt method to do this.
Last edited by pavan528; 04-14-2014 at 02:41 AM.
- 04-14-2014, 02:04 AM #2
- By AlexGraal in forum New To JavaReplies: 18Last Post: 02-23-2014, 11:28 PM
- By Ms.Ranjan in forum New To JavaReplies: 5Last Post: 04-16-2009, 06:30 PM
- By nupurashi in forum Advanced JavaReplies: 4Last Post: 04-01-2009, 07:27 PM
- By sfe23 in forum New To JavaReplies: 9Last Post: 02-19-2009, 10:37 PM
- By pheonix in forum New To JavaReplies: 2Last Post: 09-09-2008, 04:43 AM