摘要: 优先队列的作用是能保证每次取出的元素都是队列中权值最小的(Java的优先队列每次取最小元素)。这里牵涉到了大小关系,元素大小的评判可以通过元素本身的自然顺序(natural ordering),也可以通过构造时传入的比较器(Comparator)。 a-b > 0 那么这个树的根不需要调整,a是新进 阅读全文
posted @ 2022-10-23 18:52 奋斗中的菲比 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Maven 是一个项目管理工具 其中 Maven 最核心的两大概念包括 依赖管理 和 项目构建。 依赖管理:提供对 jar 的统一管理。(Maven 提供了一个中央仓库,当我们在项目中添加完依赖后,Maven 就会自动去中央仓库中下载相关依赖)。 项目构建:Maven 提供对项目的编译、测试、打包、 阅读全文
posted @ 2022-09-11 00:20 奋斗中的菲比 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 基于YOLOv5的Logo检测神经网络 Use deep learning technology to detect whether there is a brand logo in the image and locate its location. The Logo detection mode 阅读全文
posted @ 2022-08-29 23:34 奋斗中的菲比 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 什么是队列(Queue)? 队列(queue)是一种采用先进先出(FIFO,first in first out)策略的抽象数据结构。比如生活中排队,总是按照先来的先服务,后来的后服务。队列在数据结构中举足轻重,其在算法中应用广泛,最常用的就是在宽度优先搜索(BFS)中,记录待扩展的节点。 队列内部 阅读全文
posted @ 2022-08-29 23:11 奋斗中的菲比 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 为什么要使用二分查找? 普通的查找找比较多:the general find need more time! 二分搜索的有点就是时间复杂度是O(logn)的,而普通的查找时间复杂度是O(N)的。但他们所消耗的空间是一样的。同时普通查找不需要数组有序,直接for循环即可,但是二分查找需要数组有一定的顺 阅读全文
posted @ 2022-08-29 17:51 奋斗中的菲比 阅读(17) 评论(0) 推荐(0) 编辑
摘要: What is a complete binary tree? A complete binary tree is a binary tree in which all the levels except the last level, i.e., leaf node should be compl 阅读全文
posted @ 2022-07-21 12:55 奋斗中的菲比 阅读(111) 评论(0) 推荐(0) 编辑
摘要: binary search binary search time complexity = O(logn) the question usually give you a sorted array and then find a target(index) in the value: the big 阅读全文
posted @ 2022-07-19 20:36 奋斗中的菲比 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 不是O(N^2) ,是O(N)。两个指针遍历了整个数组一次 时间复杂度与最内层循环主体的执行次数有关与有多少重循环无关. The time complexity is related to the number of executions of the innermost loop body, in 阅读全文
posted @ 2022-07-19 19:19 奋斗中的菲比 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 228 · Middle of Linked List 快慢指针 慢走1, 快每次走2 初始化的时候 slow = head; fast =head.next; 并且 while的时候 java是从左到右检查 while(last!=null && last.next!=null) 如果写成 whi 阅读全文
posted @ 2022-07-17 09:26 奋斗中的菲比 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 旋转数组: 1790 · Rotate String II: 这里需要注意的是substring的 indexstart :inclusive, indexend: exclusive 2.offset need to be modulo int offset = (left - right) % 阅读全文
posted @ 2022-07-17 07:59 奋斗中的菲比 阅读(22) 评论(0) 推荐(0) 编辑