Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

December 27, 2009

Program to swap first two nodes of a list -> Adobe Question

public void interchangeFirstTwo(){
Node temp = head;
Node next = temp.next;
temp.next = next.next;
next.next = temp;
head = next;
}

No comments: