AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: lmauro — October 6, 2006
    -5 votes
      + -

    void deleteNode(node *n)
    {
    n->previous=n->next;
    delete n;
    }

  2. Submitted By: rice — October 6, 2006
    +2 votes
      + -

    void deleteNode(node *n)
    {
    node *np = n->prev;
    node *nn = n->next;
    np->next = n->next;
    nn->prev = n->prev;
    delete n;
    }

  3. Submitted By: johny_bravo — October 6, 2006
    -5 votes
      + -

    del(Node* n)
    {
    (n->prev)->next = n->next;
    delete (n);
    }

  4. Submitted By: rajesh — October 6, 2006
    +1 votes
      + -

    The 1st and 3rd solutions are incomplete as they only reset one of the 2 pointers associated with each node.
    soln 2 is complete

  5. Submitted By: asdf — October 6, 2006
    +13 votes
      + -

    void del(node *n)
    {
    (n->prev)->next = n->next;
    (n->next)->prev = n->prev;
    delete (n);
    }

    bitch

  6. Submitted By: rdakka — October 6, 2006
    +8 votes
      + -

    small correction to asdf solution

    void del(node *n)
    {
    if (!n) return;
    if (n->prev) n->prev->next = n->next;
    if (n->next) n->next->prev = n->prev;
    delete (n);
    }

  7. Submitted By: xxjjs — January 8, 2007
    +1 votes
      + -

    void del(node *n)
    {
    if (!n) return;
    if (n->prev) n->prev->next = n->next;
    else if (n->next) n->next->prev = NULL;
    if (n->next) n->next->prev = n->prev;
    else if (n->prev) n->prev->next = NULL;
    delete (n);
    }

  8. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.