View Single Post
Old 01-09-2013, 10:49 PM   PM User | #1
CoolCaptain
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
CoolCaptain is an unknown quantity at this point
Smile How to create such a kind of data structure?



First of all:
1. This isn't any homework, merely my own thought and my own work.
2. I've the detail analysis of my work "what to do?" in diagrammatic representation.
3. I've less coding skills, moreover this idea of mine made me LOST where to start to implement.
4. Moreover, I felt this seems to fun for guys who seeks coding is a challenge.
5. I'm no good in JavaScript and Logic writing, but able to design complex data structures like above.

I'm looking for a data structure, may be a linked list or Java script object or a JSON object, whatever, could be able to store such kind of relationships in the above diagram.

Some real-time implementations:

for ex: If I say generateData(100, 4); The last layer of the data structure should contain 100 objects and its parents (should be created 4 layers where Layer 0 is a parent and layer 4 is foremost child and this layer will be having 100 objects) in previous layer should adjust themselves and in first layer should have objects less than 100 (A Must).
and data structure becomes lc_data = {obj1, obj2,......obj100)

If I say generateData(100,7): The last layer of the data structure should contain 100 objects and its parents (should be created 7 layers where Layer 0 is a parent and layer 7 is foremost child and this layer will be having 100 objects) in previous layer should adjust themselves and in first layer should have objects less than 100 (A Must).
and data structure becomes lc_data = {obj1, obj2,......obj100)

I know this is a task which will challenge coders abilities and most importantly they love this kind of tasks which improves their coding abilities more and more.

Looking forward for replies with required code , seriously I'm thumping myself to see my idea to be in a code.
CoolCaptain is offline   Reply With Quote