小小程序媛 |
|
||
得之坦然,失之淡然,顺其自然,争其必然 |
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... 阅读全文
2015年12月5日
摘要:
题目Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 version2 则返回1 相等返回0 反之返回-1*/ int compar... 阅读全文
摘要:
题目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... 阅读全文
摘要:
题目Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26 -> Z27 -> A... 阅读全文
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... 阅读全文
摘要:
题目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,... 阅读全文
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... 阅读全文
摘要:
题目分析交换二叉树的左右子树。递归非递归两种方法实现。AC代码class Solution {public: //递归实现 TreeNode* invertTree(TreeNode* root) { if (!root) retur... 阅读全文
摘要:
阅读全文
摘要:
题目Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice... 阅读全文
|
Copyright © 2024 Coding菌
Powered by .NET 9.0 on Kubernetes |