![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
agaghd
Android开发
展开
-
LintCode算法题:Delete Node in a Linked List
题目 Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node. 给定一个单链表中的一个等待被删除的节点(非表头或表尾)。请在在O(1)时间复杂度删除该链表节点。 如果可以获取头节点或这个节点的上一个节点,那么这个问题就...原创 2018-05-17 08:53:04 · 158 阅读 · 0 评论 -
LintCode算法题:LRU Cache
什么是LRU 百度和谷歌有相关的连接介绍,本文不赘述。 LRU_百度百科 题目 链接:LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) ...原创 2018-05-15 16:59:56 · 210 阅读 · 0 评论 -
LintCode算法题 1363. ZigZag Conversion
题目描述: The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) And then read lin...原创 2018-07-19 15:32:32 · 264 阅读 · 0 评论 -
Lintcode155:非递归求二叉树的最小深度
题目 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 解题思路 通过层序遍历二叉树的方式,记录层序遍历的层数,在第一次遇到左...原创 2018-12-12 21:24:58 · 389 阅读 · 0 评论