File tree 1 file changed +2
-4
lines changed
src/main/java/com/rampatra/linkedlists
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 4
4
import com .rampatra .base .DoubleLinkedNode ;
5
5
6
6
/**
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> .
8
8
*
9
9
* @author rampatra
10
10
* @since 6/20/15
11
- * @time: 1:00 PM
12
- * @see: http://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/
13
11
*/
14
12
public class CloneWithRandPointers {
15
13
@@ -45,7 +43,7 @@ public static <E extends Comparable<E>> DoubleLinkedList<E> clone(DoubleLinkedLi
45
43
DoubleLinkedNode <E > dupNode ;
46
44
while (curr != null && curr .next != null ) {
47
45
dupNode = curr .next ;
48
- curr .next = ( dupNode != null ) ? dupNode .next : null ;
46
+ curr .next = dupNode .next ;
49
47
dupNode .next = (curr .next != null ) ? curr .next .next : null ;
50
48
curr = curr .next ;
51
49
}
You can’t perform that action at this time.
0 commit comments