会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
NaughtyCoder
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
5
6
7
8
9
10
11
12
13
14
下一页
2020年5月4日
【剑指offer】【树】33. 二叉搜索树的后序遍历序列
摘要: 题目链接:https://leetcode cn.com/problems/er cha sou suo shu de hou xu bian li xu lie lcof/ 递归
阅读全文
posted @ 2020-05-04 10:20 NaughtyCoder
阅读(84)
评论(0)
推荐(0)
2020年5月3日
【剑指offer】【堆】41. 数据流中的中位数
摘要: 题目链接:https://leetcode-cn.com/problems/shu-ju-liu-zhong-de-zhong-wei-shu-lcof/ 没有排序的数组 同面试题39题,利用分治的思想找出数组的中位数 插入 找中位数 时间复杂度 O(1) O(n) 排序数组 利用一个排序的数组,数
阅读全文
posted @ 2020-05-03 19:46 NaughtyCoder
阅读(105)
评论(0)
推荐(0)
【剑指offer】【字符串】48. 最长不含重复字符的子字符串
摘要: 题目链接:https://leetcode-cn.com/problems/zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof/ 双指针算法 i在前,j在后,分别指向不重复子串的头和尾;使用一个哈希表每个字符出现的次数,当遍历到j时,发现s[
阅读全文
posted @ 2020-05-03 19:37 NaughtyCoder
阅读(102)
评论(0)
推荐(0)
【剑指offer】【数学】43. 1~n整数中1出现的次数
摘要: 题目链接:https://leetcode-cn.com/problems/1nzheng-shu-zhong-1chu-xian-de-ci-shu-lcof/ 按位统计 以abcdef为例,固定其中一位为1,然后统计: 0 ~ ab - 1: 左边:ab:00 ~ ab - 1, ab个 右边:
阅读全文
posted @ 2020-05-03 19:28 NaughtyCoder
阅读(103)
评论(0)
推荐(0)
2020年4月30日
【剑指offer】【递归】46. 把数字翻译成字符串
摘要: 题目链接:https://leetcode-cn.com/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/ 递归 class Solution { public: int translateNum(int num) { if(num <= 9) re
阅读全文
posted @ 2020-04-30 08:19 NaughtyCoder
阅读(105)
评论(0)
推荐(0)
2020年4月29日
【剑指offer】【树】36. 二叉搜索树与双向链表
摘要: 题目链接:https://leetcode-cn.com/problems/er-cha-sou-suo-shu-yu-shuang-xiang-lian-biao-lcof/ 递归实现1 二叉搜索树进行中序遍历会得到递增排序的序列; 将递增排序的序列中每个元素的left和right修改,用两个指针
阅读全文
posted @ 2020-04-29 23:25 NaughtyCoder
阅读(103)
评论(0)
推荐(0)
【剑指offer】【搜索和回溯】38. 字符串的排列
摘要: 题目链接:https://leetcode-cn.com/problems/zi-fu-chuan-de-pai-lie-lcof/ 回溯1 class Solution { public: vector<string> ans; string path; vector<string> permut
阅读全文
posted @ 2020-04-29 18:22 NaughtyCoder
阅读(94)
评论(0)
推荐(0)
2020年4月28日
【剑指offer】【动态规划】49.丑数
摘要: 题目链接:https://leetcode-cn.com/problems/chou-shu-lcof/ 常规解法 从0开始依次判断是不是丑数,判断到第n个返回; 算法直观,代码简介,但是效率不高,而且直接超时了 class Solution { public: bool isUgly(int n)
阅读全文
posted @ 2020-04-28 23:19 NaughtyCoder
阅读(116)
评论(0)
推荐(0)
【剑指offer】【链表】35. 复杂链表的复制
摘要: 题目链接:https://leetcode-cn.com/problems/fu-za-lian-biao-de-fu-zhi-lcof/ 哈希 用哈希表做一个映射,hashmap的key是原先的节点,val是复制的节点。先初始化hashmap,然后分别next指针和random指针。 哈希表的作用
阅读全文
posted @ 2020-04-28 22:29 NaughtyCoder
阅读(78)
评论(0)
推荐(0)
【Debug】【mysql】ERROR 1045 (28000)
摘要: ERROR 1045 (28000) Access denied for user 'root'@'localhost' (using password: YES)最终解决方案 跳过密码验证进入mysql sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 找到[
阅读全文
posted @ 2020-04-28 18:15 NaughtyCoder
阅读(113)
评论(0)
推荐(0)
上一页
1
···
5
6
7
8
9
10
11
12
13
14
下一页
公告