摘要: 题目链接: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)
摘要: 题目链接: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)
摘要: 题目链接: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)