数据结构
文章平均质量分 51
totfly
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
三道题套路解决递归问题
三道题套路解决递归问题 https://lyl0724.github.io/2020/01/25/1/转载 2021-10-25 22:20:35 · 134 阅读 · 0 评论 -
DFS深度优先搜索说明
DFS : Depth First Search 不撞南墙不回头 Bachtracking和Depth First Search和Generate bit Mask的区别 Bachtracking:使用的是DFS方法,目的是求问题的解,如果在DFS过程中发现不是问题的解那么久回溯到上一个节点 DFS:遍历整个搜索空间不管是否是问题的解 Generate bit Mask:是DFS的一种替代实现方法 算法框架模板 result = [] def backtrac(路径,选择列表) if 满原创 2021-09-12 20:16:52 · 166 阅读 · 0 评论 -
BFS 广度优先搜索说明
BFS = Breadth First Search 广度优先搜索 用于: 遍历树结构 level order 遍历图结构 BFS,Topological 遍历二位数组 流程描述 procedure BFS(G,V): create a queue Q enqueue V on Q makr V while Q is not empty: t <- Q.dequeue() if t is what we are looking for: return t fo原创 2021-09-03 00:49:20 · 141 阅读 · 0 评论 -
常用数据结构
常考 Array int[] nums = new int[100]; Array.toString(nums) 数组转成字符串 时间复杂度O(1) String 是一种non-primitive data type:Stings,Arrays,Classes,Interfaces String str = new String(“hello”); str.substring(1,2) 截取 [1,2)的字符串 str.charAt(index) str1.compareTo(str2原创 2021-09-02 01:31:03 · 112 阅读 · 0 评论
分享