算法
文章平均质量分 65
fainionchen
这个作者很懒,什么都没留下…
展开
-
Leetcode之算法专题《LRU Cache》
题目内容如下(链接:https://leetcode.com/problems/lru-cache/description/)Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.ge...原创 2018-10-17 01:22:32 · 190 阅读 · 0 评论 -
Leetcode之算法专题《Binary Tree Maximum Path Sum》
题目内容如下(链接:https://leetcode.com/problems/binary-tree-maximum-path-sum/description/)首先说明本人代码运行速度打败了99%的人,见下图Given a non-empty binary tree, find the maximum path sum.For this problem, a path is d...原创 2018-10-20 00:10:01 · 268 阅读 · 0 评论 -
Leetcode之算法专题《Merge k Sorted Lists》
题目内容如下(链接:https://leetcode.com/problems/merge-k-sorted-lists/description/)中文说明:把k个有序的链表合并成1个有序的链表输出Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity...原创 2018-10-26 00:51:30 · 126 阅读 · 0 评论 -
Leetcode之算法专题《Implement strStr()》(By Kmp)
题目内容如下(链接:https://leetcode.com/problems/implement-strstr/description/)中文说明:用kmp算法实现strstr函数Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is n...原创 2018-11-01 01:35:25 · 193 阅读 · 0 评论 -
字节跳动2018校招算法方向(第一批)(编程题详解)
编程题1:P为给定的二维平面整数点集。定义 P 中某点x,如果x满足 P 中任意点都不在 x 的右上方区域内(横纵坐标都大于x),则称其为“最大的”。求出所有“最大的”点的集合。(所有点的横坐标和纵坐标都不重复, 坐标轴范围在[0, 1e9) 内)如下图:实心点为满足条件的点的集合。请实现代码找到集合 P 中的所有 ”最大“ 点的集合并输出。思路分析:按照x坐标排序,排序完用y坐标...原创 2018-11-05 18:24:30 · 2603 阅读 · 1 评论