on datastructure plz solve this

Discussion in 'C Programming' started by raju, Jan 5, 2006.

  1. raju

    raju Guest

    i am having a single linked list say 5 node are present, and one
    pointer that is pointing to 3rd node using this pointer only i have to
    come to the 1st node..... or how can i get back to the 1st node........
     
    raju, Jan 5, 2006
    #1
    1. Advertising

  2. raju wrote:
    > i am having a single linked list say 5 node are present, and one
    > pointer that is pointing to 3rd node using this pointer only i have to
    > come to the 1st node..... or how can i get back to the 1st node........


    <OT>
    first of all you should be careful posting your homework assignments in
    news groups, your teacher might also be monitoring them. you might be
    accused of using unfare means.
    secondly this is not the right group to ask, try some datastructure
    related group.
    </OT>
     
    Haroon Shafiq, Jan 5, 2006
    #2
    1. Advertising

  3. raju

    Chris Dollin Guest

    raju wrote:

    > i am having a single linked list say 5 node are present, and one
    > pointer that is pointing to 3rd node using this pointer only i have to
    > come to the 1st node..... or how can i get back to the 1st node........


    (a) this is not a C question.

    (b) if it were a C question, you haven't given us enough information;
    what code have you already tried? What, exactly, went wrong?

    (c) You can't. If you're careless enough to lose the pointer to the
    list head, you can't backtrack. In the words of the doctor,
    "don't do that.".

    --
    Chris "believes seventeen improbable things before coffee" Dollin
    Seventeen, forty-two - what else is there?
     
    Chris Dollin, Jan 5, 2006
    #3
  4. raju

    tmp123 Guest

    raju wrote:
    > i am having a single linked list say 5 node are present, and one
    > pointer that is pointing to 3rd node using this pointer only i have to
    > come to the 1st node..... or how can i get back to the 1st node........


    Some tipical posibilities are:

    a) (obvious, but mandatory to remark): do you need to go again to 1st
    node?. Review your algorithm to see if it is mandatory or not.
    b) (also obvious): Keep a pointer to list head
    c) Look for information about "double linked list".
    ....

    Kind regards.

    PS: Some prereplies to next 20 post: a) I've googled for
    "datastructure" and in the first 5 answers there are 4 related to
    language specific groups (including this one). In order to forward to
    another group, I've decided to provided a few more keywords. b) I do
    not debate why a person looks for information in groups instead of in a
    book or teacher.
     
    tmp123, Jan 5, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. brian

    Size of my Struct? PLZ PLZ reply

    brian, Nov 23, 2004, in forum: C Programming
    Replies:
    7
    Views:
    421
    -berlin.de
    Nov 25, 2004
  2. Replies:
    1
    Views:
    387
  3. Replies:
    2
    Views:
    342
    Nick Keighley
    Nov 24, 2006
  4. Replies:
    1
    Views:
    350
  5. nocturnal
    Replies:
    1
    Views:
    534
    nocturnal
    Jul 10, 2009
Loading...

Share This Page