上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 33 下一页
摘要: 题目: A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its 阅读全文
posted @ 2015-05-09 12:39 YRB 阅读(1071) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two strings S and T, determine if they are both one edit distance apart. 链接: http://leetcode.com/problems/one-edit-distance/ 题解: 求两个字符串是否只有1 阅读全文
posted @ 2015-05-09 12:38 YRB 阅读(503) 评论(0) 推荐(0) 编辑
摘要: 题目: 链接: http://leetcode.com/problems/intersection-of-two-linked-lists/ 题解: 题目理解起来比较容易,两个单链表求交叉点。数学上来讲使用两个runner,一个链表走完以后继续走另外一个链表,假如有交叉点则两个节点相等的时候正好走了 阅读全文
posted @ 2015-05-09 12:37 YRB 阅读(466) 评论(1) 推荐(0) 编辑
摘要: 题目:Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba”,T is "ece" whi... 阅读全文
posted @ 2015-05-09 12:37 YRB 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 题目: The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it 阅读全文
posted @ 2015-05-09 12:36 YRB 阅读(873) 评论(0) 推荐(0) 编辑
摘要: 题目: The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it 阅读全文
posted @ 2015-05-09 12:35 YRB 阅读(895) 评论(1) 推荐(0) 编辑
摘要: 题目: Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip i 阅读全文
posted @ 2015-05-09 12:34 YRB 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 题目: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- R 阅读全文
posted @ 2015-05-09 12:33 YRB 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 题目:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a s... 阅读全文
posted @ 2015-05-09 12:30 YRB 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 elem 阅读全文
posted @ 2015-05-09 12:14 YRB 阅读(206) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 33 下一页