Update LinkedListAlgo.java
fix
This commit is contained in:
parent
4e75d73e00
commit
0747104188
@ -20,13 +20,8 @@ public class LinkedListAlgo {
|
||||
pre = curr;
|
||||
curr = next;
|
||||
}
|
||||
//我的比教程更加简洁
|
||||
if (pre == null) {
|
||||
return list;
|
||||
} else {
|
||||
return pre;
|
||||
}
|
||||
}
|
||||
|
||||
// 检测环
|
||||
public static boolean checkCircle(Node list) {
|
||||
|
Loading…
Reference in New Issue
Block a user