
-----------------------------------
randint
Wed Dec 05, 2012 11:23 pm

Removing an element from a Linked List
-----------------------------------
How do you remove an element from a custom (non built-in) LinkedList?

import java.io.*;
public class Node
{
    Node next;
    String data;

    public Node (String data)
    {
        this.data = data;
    }
}

public class LinkedListExerciseSolution
{
    public static void main (String
What do I need to do in order to remove a node (as specified by the user)?

-----------------------------------
Panphobia
Wed Dec 05, 2012 11:27 pm

RE:Removing an element from a Linked List
-----------------------------------
http://www.cs.bu.edu/teaching/cs112/spring-2000/linked-list-delete/

-----------------------------------
Tony
Thu Dec 06, 2012 12:33 am

Re: Removing an element from a Linked List
-----------------------------------
What do I need to do in order to remove a node (as specified by the user)?
I find that drawing this out as a diagram on paper is very helpful in understanding what needs to happen. http://compsci.ca/blog/super-paper-programming/

-----------------------------------
joshm
Thu Dec 06, 2012 8:29 am

RE:Removing an element from a Linked List
-----------------------------------
find the node before the node you want to remove, then set the next node to the node after the node you want to remove
