摘要: 移除链表元素 l_203 | 设计链表 l_707 |反转链表 l_206 阅读全文
posted @ 2023-03-18 20:59 Snowy1899 阅读(12) 评论(0) 推荐(0)
摘要: 有序数组的平方 考虑到数组中元素存在负数的情况,数组元素平方之后,最大值存在于新数组的两边,这里采用“双指针法”可以满足时间复杂度为O(n) 若对数组中的元素平方之后再去排序,可以采用快速排序的方式,此时的时间复杂度为O(nlogn) 这里给出双指针的解法、 /** * @param {number 阅读全文
posted @ 2023-03-17 23:10 Snowy1899 阅读(16) 评论(0) 推荐(0)
摘要: 二分查找 题目链接:https://leetcode.cn/problems/binary-search/ 文章讲解:https://programmercarl.com/0704.%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE.html 视频讲解:https://www. 阅读全文
posted @ 2023-03-15 22:42 Snowy1899 阅读(21) 评论(0) 推荐(0)