ACM
文章平均质量分 54
笑傲1024
这个作者很懒,什么都没留下…
展开
-
【LeetCode】-Insertion Sort List
Sort a linked list using insertion sort.原创 2014-09-21 21:55:30 · 238 阅读 · 0 评论 -
【LeetCode】-Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now [1,1,2,原创 2014-09-24 16:54:11 · 217 阅读 · 0 评论 -
【LeetCode】-Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#,#,15,7},原创 2014-09-24 15:11:35 · 195 阅读 · 0 评论 -
【LeetCode】-Single Number
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e原创 2014-09-22 16:46:13 · 196 阅读 · 0 评论 -
【LeetCode】-Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?原创 2014-09-22 16:32:21 · 171 阅读 · 0 评论 -
【LeetCode】-Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements fro原创 2014-09-22 17:21:37 · 203 阅读 · 0 评论 -
【LeetCode】-Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),原创 2014-09-22 16:54:07 · 206 阅读 · 0 评论 -
【LeetCode】-Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy t原创 2014-09-22 17:19:31 · 206 阅读 · 0 评论 -
【LeetCode】-Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?原创 2014-09-22 17:08:38 · 172 阅读 · 0 评论 -
【LeetCode】-Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".原创 2014-09-21 18:29:05 · 202 阅读 · 0 评论 -
【LeetCode】-Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.原创 2014-09-24 15:55:19 · 207 阅读 · 0 评论