随笔分类 -  数据结构与算法

摘要:算法题目大纲 阅读全文
posted @ 2024-02-28 00:53 牵我狗 阅读(4) 评论(0) 推荐(0) 编辑
摘要:问题描述 // 斐波那契数列 输入序列,返回值 // (1,1,2,3,5,8,13,21,。。。。。) // 例如 input 3 output 3 递归版 // 递归版 @Test void feibonaqi2() { int sum=sum2(-9); System.out.println( 阅读全文
posted @ 2021-06-29 14:54 牵我狗 阅读(155) 评论(1) 推荐(2) 编辑
摘要:import java.util.Stack; public class MainClass4 { public static void main(String[] args) { BanaryTree head = init(); whilePrint(head); System.out.prin 阅读全文
posted @ 2021-06-22 18:11 牵我狗 阅读(182) 评论(0) 推荐(0) 编辑
摘要:package com.mashibing.drools; public class MainClass3 { public static void main(String[] args) { Nodes head1 = init(); head1 = revert(head1); print(he 阅读全文
posted @ 2021-06-22 16:27 牵我狗 阅读(30) 评论(0) 推荐(0) 编辑
摘要:class hanluota { public static void main(String[] args) { int nDisks = 2; move(nDisks, 'A', 'B', 'C'); } public static void move(int n, char from, cha 阅读全文
posted @ 2021-06-22 15:21 牵我狗 阅读(84) 评论(0) 推荐(0) 编辑
摘要:public static void main(String[] args) { int [] arr= {1,2,3,4,5,6,7,8}; // 使用hash表作为缓存 HashMap<Integer, Integer> buf = new HashMap<>(); int second; fo 阅读全文
posted @ 2021-06-22 15:11 牵我狗 阅读(64) 评论(0) 推荐(0) 编辑
摘要:第1节 评估算法优劣的核心指标是什么 时间复杂度(流程决定) 额外空间复杂度(流程决定) 常数项时间(实现细节决定) 什么是时间复杂度?时间复杂度怎么估算? 常数时间的操作 确定算法流程的总操作数量与样本数量之间的表达式关系 只看表达式最高阶项的部分 何为常数时间的操作? 如果一个操作的执行时间不以 阅读全文
posted @ 2021-06-15 12:27 牵我狗 阅读(241) 评论(0) 推荐(0) 编辑
摘要:1. 冒泡排序 (BubbleSort) func TestBubbleTest(t *testing.T) { arr := []int{2, 3, 5, 1, 5, 7, 4} bubbleSort(arr) for i := 0; i < len(arr); i++ { fmt.Print(a 阅读全文
posted @ 2021-06-04 10:50 牵我狗 阅读(165) 评论(6) 推荐(1) 编辑
摘要:本文是对算法图解的读书笔记,以及学习算法过程的记录,(会不断修改) 1.0 第一部分(大体介绍) 2.0 第二部分(资源推荐) 算法图解github 源码 https://github.com/amongstar/https-github.com-egonSchiele-grokking_algor 阅读全文
posted @ 2020-03-01 03:08 牵我狗 阅读(157) 评论(0) 推荐(0) 编辑
摘要:链表图解 带头结点的链表: 不带头结点的链表: 区别 带头结点的链表容易代码实现 不带头结点的容易实现循环链表和双向链表 代码的实现 (增减 删除) 节点实现: 链表实现: 链表的应用 :约瑟夫问题的求解 问题描述:在罗马人占领乔塔帕特后,39 个犹太人与Josephus及他的朋友躲到一个洞中,39 阅读全文
posted @ 2019-08-26 08:17 牵我狗 阅读(1266) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示