- 博客(2)
- 收藏
- 关注
原创 反转链表(迭代)
反转链表迭代:public ListNode reverseList(ListNode head) { if(head == null ||head.next == null) { return head; } ListNode pre = null; ListNode cur = head; while(cur != null) { ListNode next = cur.
2021-02-02 21:03:26 92
原创 求两数之和
求两数之和给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 的那 两个 整数,并返回它们的数组下标。方法1.循环嵌套(代码如下)class Solution { public int[] twoSum(int[] nums, int target) { if(nums.length == 0) { return null; } int i = 0; int[]
2021-02-02 19:41:24 499
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人