Show differencesHistory of post edits
#6neob
Posted 05 April 2012 - 07:49 AM
I have a Generic Linked list in Java.
I want to switch positions of two nodes on a list. Where a was I want to put b and where b was I want to put a.
How do I do this?
class Node
{
T info ;
Node next;
Node (T x)
{
info = x;
next = null;
}
}
I want to switch positions of two nodes on a list. Where a was I want to put b and where b was I want to put a.
public void switcherT a, T b)
{
// Stuck.
}
How do I do this?
#5neob
Posted 05 April 2012 - 06:33 AM
I have a Generic Linked list in Java.
I want to switch positions of two nodes on a list. Where a was I want to put b and where b was I want to put a.
How do I do this?
class Node
{
T info ;
Node next ;
Node (T x)
{
info = x ;
next = null ;
}
}
I want to switch positions of two nodes on a list. Where a was I want to put b and where b was I want to put a.
public void switcherT a, T b)
{
// Stuck.
}
How do I do this?
#4neob
Posted 05 April 2012 - 06:25 AM
I have a Generic Linked list in Java.
I want to switch positions of two nodes on a list.
How do I do this?
class Node
{
T info ;
Node next ;
Node (T x)
{
info = x ;
next = null ;
}
}
I want to switch positions of two nodes on a list.
public void switcherT a, T b)
{
// Stuck.
}
How do I do this?
#3neob
Posted 05 April 2012 - 06:24 AM
I have a Generic Linked list in Java.
I want to switch positions of two nodes on a list.
How do I do this?
class Node
{
T info ;
Node next ;
Node (T x)
{
info = x ;
next = null ;
}
}
I want to switch positions of two nodes on a list.
public void switcherT a, T b)
{
// Stuck.
}
How do I do this?
#2neob
Posted 05 April 2012 - 06:24 AM
I have a Generic Linked list in Java.
I want to switch positions of two nodes on a list.
How do I do this?
class Node
{
T info ;
Node next ;
Node (T x)
{
info = x ;
next = null ;
}
}
I want to switch positions of two nodes on a list.
public void switcherT a, T b)
{
// Stuck.
}
How do I do this?