小小程序媛  
得之坦然,失之淡然,顺其自然,争其必然
上一页 1 2 3 4 5 6 7 8 ··· 34 下一页

2015年12月7日

摘要: 题目Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/spac... 阅读全文
posted @ 2015-12-07 13:08 Coding菌 阅读(145) 评论(0) 推荐(0) 编辑

2015年12月5日

摘要: 题目Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 version2 则返回1 相等返回0 反之返回-1*/ int compar... 阅读全文
posted @ 2015-12-05 15:16 Coding菌 阅读(181) 评论(0) 推荐(0) 编辑
 
摘要: 题目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 retur... 阅读全文
posted @ 2015-12-05 14:08 Coding菌 阅读(109) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26 -> Z27 -> A... 阅读全文
posted @ 2015-12-05 13:38 Coding菌 阅读(105) 评论(0) 推荐(0) 编辑

2015年12月4日

摘要: 题目Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right c... 阅读全文
posted @ 2015-12-04 14:22 Coding菌 阅读(128) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2,... 阅读全文
posted @ 2015-12-04 13:31 Coding菌 阅读(104) 评论(0) 推荐(0) 编辑

2015年12月3日

摘要: 题目Given a singly linked list, determine if it is a palindrome.Follow up: Could you do it in O(n) time and O(1) space?分析判断一个链表是否为回文。要求时间复杂度O(n... 阅读全文
posted @ 2015-12-03 13:30 Coding菌 阅读(133) 评论(0) 推荐(0) 编辑
 
摘要: 题目分析交换二叉树的左右子树。递归非递归两种方法实现。AC代码class Solution {public: //递归实现 TreeNode* invertTree(TreeNode* root) { if (!root) retur... 阅读全文
posted @ 2015-12-03 12:59 Coding菌 阅读(101) 评论(0) 推荐(0) 编辑
 
摘要: 阅读全文
posted @ 2015-12-03 12:58 Coding菌 阅读(90) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice... 阅读全文
posted @ 2015-12-03 12:46 Coding菌 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 34 下一页