As you mentioned, the numbers designating the gaps can only be repeated so in your example 2 20 can be broken into 19 1 but 19 is already there in the list (the first couplet) and it's not the one which describes the gap. can you please clarify?
On Mon, Nov 21, 2011 at 5:23 AM, Ankur Garg <ankurga...@gmail.com> wrote: > a linked list contains > 2 19 _ _ 3 47 _ _ _ 2 20 _ _ ..............and so on > I have to fill those empty nodes with numbers whose sum is equal to the > numbers > occurring just before the gaps and the number of gaps is determined by the > node > which is at 2 distance before the gaps with the limitation that their > would be no > repetition in list only the nodes designating the number of gaps can be > repeated > for example 2 20 should be broken in two parts like 19 1 > 3 47 should be broken in three parts like 42 2 3 > and not in 44 1 2 because 1 already occurred in the list due previous > partition > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.