Skip to content

Commit

Permalink
思路调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Xikl committed Mar 1, 2021
1 parent 8ece3f9 commit 644b75d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class Solution {
*/
public ListNode removeElements(ListNode head, int val) {
// return removeElementsByHeadAndHelpGc(head, val);
// return removeElementByDummyHead(head, val);
return removeElementsByHeadAndNotHelpGc(head, val);
return removeElementByDummyHead(head, val);
// return removeElementsByHeadAndNotHelpGc(head, val);
}


Expand Down Expand Up @@ -159,6 +159,9 @@ public static void main(String[] args) {
int[] nums = {1, 2, 6, 5, 6, 4};
ListNode head = new ListNode(nums);
System.out.println(head);
Solution solution = new Solution();
ListNode listNode = solution.removeElements(head, 6);
System.out.println(listNode);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public E getLast() {

/**
* 修改其中的值
* todo
* todo 还没完成
* @param index 所因为位置
* @param element 元素
*/
Expand Down

0 comments on commit 644b75d

Please sign in to comment.