Web Analytics Made Easy -
StatCounter Programming help(test ur skill)? - CodingForum

Announcement

Collapse
No announcement yet.

Programming help(test ur skill)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Programming help(test ur skill)?

    input:
    page parent
    1 1
    2 1
    3 2
    4 1
    5 2
    6 5
    7 2
    8 1
    9 3
    10 2

    output:



    1
    2
    3
    9
    5
    6
    7
    10
    4
    8

    like folder hierarchy in xp.

    it seems complex for me as i have no time to think

    about it about i need the code .it would be better

    if code is done by PHP. but any other language is

    acceptable.

    please help me expert if possible
    Last edited by deshi2003; Apr 13, 2009, 01:48 AM.
    http://www.atneshop.com/
    http://channelishop.com/

  • #2
    The task is not easy to implement but there is too few information about categories and subcategories. I have started writing the program and when I almost finish I found one simple example which make impossible to make correct decision where that subcategory should be mounted
    1 1
    2 1
    3 2
    4 1
    5 1
    5 2

    6 5
    7 2
    8 1
    9 3
    so you can see that 1 > 5 and 2 > 5 and next line mount 6 on 5 where I have to mount? 1's 5th or 2's 5th? So based on the information your gave us it is logically impossible. If you will have something like 5 4 2 1 then ok, it could be implemented. Or you should give guarantee that such situation will not be in a program or if it could be how the decision should be made?

    p.s. Just friendly advice, it is not good idea to use words i have no time to think or you will never get answer Because it looks like others are free and you are very, very busy
    Last edited by PHP6; Apr 13, 2009, 04:19 AM.

    Comment


    • #3
      Hi deshi2003,
      The following url describes a way to display data like you asked (it takes the data from a mysql table.)
      http://www.codeassembly.com/How-to-d...and-javascript
      Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

      Comment

      Working...
      X