Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualneob

Posted 06 April 2012 - 01:37 PM

.

#6neob

Posted 05 April 2012 - 07:49 AM

I have a Generic Linked list in Java.
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.
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.
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.
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.
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?

PARTNERS