网站首页 站内搜索

搜索结果

查询Tags标签: fast,共有 188条记录
  • 数据结构与算法——找出单链表中的倒数第k个元素

    如何找出单链表中的倒数第k个元素 方法一:顺序遍历两遍 首先遍历一遍单链表,求出整个单链表的长度n,然后把求倒数第k个元素转换为求正数第n-k个元素,再去遍历一次就可以得到结果 方法二:快慢指针法 在查找过程中,设置两个指针,让其中一个指针比另一个指针先前移k步…

    2021/7/26 12:05:34 人评论 次浏览
  • 【快慢指针2】 移除元素

    移除元素 给你一个数组 nums 和一个值 val,你需要 原地 移除所有数值等于 val 的元素,并返回移除后数组的新长度。 输入:nums = [3,2,2,3], val = 3 输出:2, nums = [2,2] 解释:函数应该返回新的长度 2, 并且 nums 中的前两个元素均为 2。 你不需要考虑数组中超出新长…

    2021/7/17 23:11:42 人评论 次浏览
  • 【快慢指针2】 移除元素

    移除元素 给你一个数组 nums 和一个值 val,你需要 原地 移除所有数值等于 val 的元素,并返回移除后数组的新长度。 输入:nums = [3,2,2,3], val = 3 输出:2, nums = [2,2] 解释:函数应该返回新的长度 2, 并且 nums 中的前两个元素均为 2。 你不需要考虑数组中超出新长…

    2021/7/17 23:11:42 人评论 次浏览
  • 车道线检测研究

    关于车道线检测,最近研究以下资料: 推荐论文:Ultra Fast Structure-aware Deep Lane Detection,https://arxiv.org/abs/2004.11757 参考代码:https://github.com/cfzd/Ultra-Fast-Lane-Detection.git

    2021/7/13 23:41:50 人评论 次浏览
  • 车道线检测研究

    关于车道线检测,最近研究以下资料: 推荐论文:Ultra Fast Structure-aware Deep Lane Detection,https://arxiv.org/abs/2004.11757 参考代码:https://github.com/cfzd/Ultra-Fast-Lane-Detection.git

    2021/7/13 23:41:50 人评论 次浏览
  • python实现删除链表倒数第n个节点

    # 删除链表倒数第n个节点。假设n大于0 def remove_nth_from_end(head):fast = headcount = 0while fast and count < n:fast = fast._nextcount += 1if not fast and count < n: # not that many nodesreturn headif not fast and count == n:return head._nextslo…

    2021/7/12 20:07:53 人评论 次浏览
  • python实现删除链表倒数第n个节点

    # 删除链表倒数第n个节点。假设n大于0 def remove_nth_from_end(head):fast = headcount = 0while fast and count < n:fast = fast._nextcount += 1if not fast and count < n: # not that many nodesreturn headif not fast and count == n:return head._nextslo…

    2021/7/12 20:07:53 人评论 次浏览
  • python返回链表中点

    def find_middle(self):if not self._head or self._head.next is None:return self._headfast, slow = self._head, self._headfast = fast.nextwhile fast and fast.next:slow = slow.nextfast = fast.next.nextreturn slow

    2021/7/12 20:07:49 人评论 次浏览
  • python返回链表中点

    def find_middle(self):if not self._head or self._head.next is None:return self._headfast, slow = self._head, self._headfast = fast.nextwhile fast and fast.next:slow = slow.nextfast = fast.next.nextreturn slow

    2021/7/12 20:07:49 人评论 次浏览
  • [LeetCode]287. Find the Duplicate Number 图解Floyd判圈(龟兔赛跑)算法

    题目描述 Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without modifying the array nums…

    2021/7/10 17:09:34 人评论 次浏览
  • [LeetCode]287. Find the Duplicate Number 图解Floyd判圈(龟兔赛跑)算法

    题目描述 Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without modifying the array nums…

    2021/7/10 17:09:34 人评论 次浏览
  • boost::hana::detail::fast_and用法的测试程序

    boost::hana::detail::fast_and用法的测试程序 实现功能 C++实现代码实现功能 boost::hana::detail::fast_and用法的测试程序 C++实现代码 #include <boost/hana/detail/fast_and.hpp> namespace hana = boost::hana; static_assert(hana::detail::fast_and<&g…

    2021/7/8 12:36:21 人评论 次浏览
  • fast-poster海报生成器v1.4.0,一分钟完成海报开发

    fast-poster海报生成器v1.4.0,一分钟完成海报开发 介绍 一个快速开发动态海报的工具 在线体验:https://poster.prodapi.cn/ v1.4.0 新特性为了项目和团队的健康发展,修改开源授权许可协议。 团队成员方面,引入前兴盛优选技术大牛,技术站上了新的起点,以后会输出更多…

    2021/7/8 6:06:12 人评论 次浏览
  • 每日一题-Day20-判断链表是否为回文结构

    题目 给定一个链表,请判断该链表是否为回文结构。 解题思路 ​ 遍历(将链表分成两部分进行比较) 创建两个与原链表相同的链表,first和slow,first指针每次移动两次,slow指针每次移动一次,当first移动至null时,该链表为偶数个,如果不为null,则是奇数个,可以自己画…

    2021/7/7 6:04:53 人评论 次浏览
  • 443. String Compression

    Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars:If the groups length is 1, append the character to s. Otherwise, append the charac…

    2021/7/2 6:21:13 人评论 次浏览
扫一扫关注最新编程教程