LeetCode[Bitwise]----Bitwise AND of Numbers Range

Bitwise AND of Numbers Range Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4. 分析: 给定m和n,返回m到n闭区间内所有元素位运算...

2016-05-02 23:40:48

阅读数 758

评论数 0

LeetCode[Stack]----Min Stack&Stack&Queue

整理一下LeetCode上三道与栈有关的题,分别是Implement Queue using Stacks,Implement Stack using Queues和Min Stack。 1.Implement Queue using Stacks Implemen...

2016-04-30 15:25:48

阅读数 3771

评论数 0

LeetCode[Design]----Peeking Iterator

Peeking Iterator Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the...

2016-04-22 21:11:02

阅读数 2080

评论数 0

LeetCode[Math]----Excel Sheet Column Title----Excel Sheet Column Number

Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -&g...

2016-04-22 16:28:27

阅读数 1285

评论数 0

LeetCode[Array]---- 4Sum

4Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in t...

2016-04-19 11:28:08

阅读数 745

评论数 0

LeetCode[Array]----3Sum Closest

3Sum Closest   Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the su...

2016-04-19 10:03:10

阅读数 706

评论数 0


3Sum Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives t...

2016-04-18 21:20:11

阅读数 631

评论数 0

LeetCode----Lowest Common Ancestor of a Binary Tree

Lowest Common Ancestor of a Binary Tree Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. Accordin...

2016-03-08 14:44:40

阅读数 552

评论数 0

LeetCode----Lowest Common Ancestor of a Binary Search Tree

Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the...

2016-03-08 14:00:40

阅读数 454

评论数 0

LeetCode----Maximum Product Subarray

Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For e...

2016-02-27 15:44:38

阅读数 543

评论数 0

LeetCode----Isomorphic Strings

Isomorphic Strings Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be re...

2015-12-02 09:05:44

阅读数 503

评论数 0

LeetCode----Insertion Sort List

Insertion Sort List Sort a linked list using insertion sort. 原题链接为:https://leetcode.com/problems/insertion-sort-list 分析: 使用插入排序对链表进行排序。 可以新建一个带头...

2015-11-14 17:16:52

阅读数 477

评论数 0

LeetCode----Sort List

Sort List Sort a linked list in O(n log n) time using constant space complexity. 分析: 给链表排序,要求O(nlogn)的时间,O(1)的空间。 链表不是数组,给它排序不能像数组一样可以通...

2015-11-14 15:42:18

阅读数 456

评论数 0

LeetCode----Happy Number

Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process:...

2015-11-11 10:21:52

阅读数 527

评论数 0

LeetCode----Remove Duplicates from Sorted Array

Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the ne...

2015-11-10 18:46:35

阅读数 472

评论数 0

LeetCode----Generate Parentheses

Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, g...

2015-11-10 15:59:44

阅读数 1141

评论数 0

LeetCode----Find the Duplicate Number

Find the Duplicate Number Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least...

2015-11-02 11:11:01

阅读数 688

评论数 0

LeetCode----Move Zeroes

Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elem...

2015-11-01 23:21:05

阅读数 633

评论数 0

LeetCode----Word Pattern

Word Pattern Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a...

2015-11-01 20:01:57

阅读数 656

评论数 0

LeetCode----Partition List

Partition List Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. ...

2015-11-01 16:29:56

阅读数 569

评论数 0

取消 删除