随笔分类 - LeetCode
摘要:题目: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution
阅读全文
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element.
阅读全文
摘要:题意: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the bal
阅读全文
摘要:题意: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exi
阅读全文
摘要:题意: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get
阅读全文
摘要:题目: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 思路: 这道题目并不难。暴力枚举其它点与当前点的斜率。 复杂度为 O(n^2). 可能是由于
阅读全文
摘要:转载请注明出处: http://www.cnblogs.com/gufeiyang 个人微博:flysea_gu 题意: Given two words (beginWord and endWord), and a dictionary's word list, find the length of
阅读全文
摘要:转载请注明出处: http://www.cnblogs.com/gufeiyang 个人微博:flysea_gu 题意: Merge two sorted linked lists and return it as a new list. The new list should be made by
阅读全文
摘要:转载请注明出处: http://www.cnblogs.com/gufeiyang 个人微博:flysea_gu 题目描述: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix
阅读全文
摘要:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:坐标是i,j的元素旋转90坐标变...
阅读全文

浙公网安备 33010602011771号