上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 80 下一页
摘要: Reverse a singly linked list.思路:没啥好说的。秒...ListNode* reverseList(ListNode* head) { ListNode * rList = NULL, * tmp = NULL; while(head != N... 阅读全文
posted @ 2015-05-21 10:38 匡子语 阅读(166) 评论(0) 推荐(0)
摘要: Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-05-21 10:26 匡子语 阅读(265) 评论(0) 推荐(0)
摘要: Count the number of prime numbers less than a non-negative number,n思路:数质数的个数开始写了个蛮力的,存储已有质数,判断新数字是否可以整除已有质数。然后妥妥的超时了(⊙v⊙)。看提示,发现有个Eratosthenes算法找质数的,说... 阅读全文
posted @ 2015-05-21 10:13 匡子语 阅读(224) 评论(0) 推荐(0)
摘要: Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac... 阅读全文
posted @ 2015-05-20 11:01 匡子语 阅读(266) 评论(0) 推荐(0)
摘要: Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially... 阅读全文
posted @ 2015-05-19 10:31 匡子语 阅读(242) 评论(0) 推荐(0)
摘要: Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i... 阅读全文
posted @ 2015-05-18 08:59 匡子语 阅读(303) 评论(0) 推荐(0)
摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文
posted @ 2015-05-17 21:19 匡子语 阅读(183) 评论(0) 推荐(0)
摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2015-05-06 14:13 匡子语 阅读(212) 评论(0) 推荐(0)
摘要: Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2015-05-06 12:57 匡子语 阅读(232) 评论(0) 推荐(0)
摘要: Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
posted @ 2015-05-06 11:16 匡子语 阅读(204) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 80 下一页