Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf38309d

Browse files
edit 138
1 parent5ec836e commitf38309d

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-1
lines changed

‎src/main/java/com/fishercoder/solutions/_138.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
publicclass_138 {
1212

1313
publicRandomListNodecopyRandomList(RandomListNodehead) {
14+
/**Key is the original nodes, value is the new nodes we're deep copying to.*/
1415
Map<RandomListNode,RandomListNode>map =newHashMap();
1516
RandomListNodenode =head;
1617

17-
//loop for the first time: copy the node themselves
18+
//loop for the first time: copy the node themselves with only labels
1819
while(node !=null){
1920
map.put(node,newRandomListNode(node.label));
2021
node =node.next;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp