Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6735c60

Browse files
author
Ram swaroop
committed
pairwise swap: refactoring
1 parent 4476b30 commit 6735c60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/me/ramswaroop/linkedlists/PairWiseSwap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class PairWiseSwap {
1414

1515
/**
1616
* Recursively swaps adjacent nodes of a linked list.
17-
* The swapping is done in place.
1817
*
1918
* @param node
19+
* @return new starting node after swapping adjacent nodes.
2020
*/
2121
public static <E extends Comparable<E>> SingleLinkedNode<E> pairWiseSwap(SingleLinkedNode<E> node) {
2222
if (node == null || node.next == null) return node;

0 commit comments

Comments
 (0)