If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

EMERGENT.... double linked list

Q-1)Write a node class to keep the followings:
the adress of the next node
the adress of the node comes after the next node
the adress of the previous node
the adress of the node comes before the previous node

You should only fill the methods with proper Java code if not filled yet[those
which are bulleted]

//set the node comes after the next node.You should set the next item's values
//also
public void setAfterNext (NODE afterNextNode)
{
·
}//end setAfterNext
//get the reference of the node comes after next
public NODE getAfterNext()
{
·
}// end getAfterNext
//set the node which is the before previous
public void setBeforePrev(NODE beforePrevNode)
{
·
}//end setBeforePrev
//get the reference of the node which comes before the previous
public NODE getBeforePrev()
{
·
}//end getBeforePrev

}// end class node

Q-2)
Write insert,delete and removeAll methods for a doubly linked list using
the NODE class defined in the question1 .This linked list should satisfy
the double connection to both one node before the previous and one node after
the next node,i.e. each node of the linked list should be connected to all
of the previous and one before the previous;next, and one after the next
nodes

AND use your linked list definition to do create a list with followings
items:
Integer(1), Integer(5), Integer(10), Integer(23), Integer(30), Integer(35),