File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
src/main/java/com/rampatra/linkedlists Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 44import com .rampatra .base .DoubleLinkedNode ;
55
66/**
7- * Created by IntelliJ IDEA .
7+ * Find the <a href="http://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/">question here</a> .
88 *
99 * @author rampatra
1010 * @since 6/20/15
11- * @time: 1:00 PM
12- * @see: http://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/
1311 */
1412public class CloneWithRandPointers {
1513
@@ -45,7 +43,7 @@ public static <E extends Comparable<E>> DoubleLinkedList<E> clone(DoubleLinkedLi
4543 DoubleLinkedNode <E > dupNode ;
4644 while (curr != null && curr .next != null ) {
4745 dupNode = curr .next ;
48- curr .next = ( dupNode != null ) ? dupNode .next : null ;
46+ curr .next = dupNode .next ;
4947 dupNode .next = (curr .next != null ) ? curr .next .next : null ;
5048 curr = curr .next ;
5149 }
You can’t perform that action at this time.
0 commit comments