自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 资源 (3)
  • 收藏
  • 关注

原创 33. Search in Rotated Sorted Array

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).You are given a target value to search. If found in the array return its index

2016-07-26 19:21:28 167

原创 Max Sum of Rectangle No Larger Than K

对于一维数组求最大的和并且不大于K对于二维数组,转化为一维的迭代代码:class Solution {public: int maxSumSubmatrix(vector<vector<int>>& matrix, int k) { if (matrix.empty()) return 0; int row = matrix.si

2016-07-22 15:23:10 257

原创 50.Pow(x,n)

求x的幂次方Implement pow(x, n).二分法注意-n 转化为n的时候溢出,需要处理一下class Solution {//超时用不了public:double myPow(double x, int n) { if(n==0) return 1; double t = myPow(x,n/2); if(n%2) return n<0 ? 1/x*t*t

2016-07-22 09:57:51 220

原创 236. Lowest Common Ancestor of a Binary Tree

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes v and

2016-07-18 22:00:41 181

原创 119. 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].这就是杨辉三角class Solution {public: vector<int> getRow(int rowIndex) { vector<int> row(

2016-07-11 09:50:36 153

原创 24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may no

2016-07-05 11:30:13 185

原创 1.Two Sum

1.Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example: Given nums =

2016-06-22 10:42:45 142

原创 337 leetcode House Robber III

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2016-06-22 09:50:21 217

原创 237. Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, t

2016-04-07 11:11:09 166

原创 字符串以为包含问题

char src[] = "AABBCD"; char des[] = "CDAA";如上两个字符串,则输出true#include <stdio.h>#include <assert.h>#include <string.h>int main(){ char src[] = "AABBCD"; char des[] = "CDAA"; int len = strlen(src);

2016-03-31 19:17:48 176

原创 C语言字符串strlen函数使用

计算字符串长度 以及自己实现一个strlen的函数 用法 #include #include <stdio.h>#include <assert.h>#include <string.h>typedef unsigned int u_int;u_int Mystrlen(char *str);int main(){ char *s = "Melissa Yang"; printf(

2016-03-31 17:40:46 1068

原创 326. Power of Three LeetCode解题报告

Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 解法一:采用循环,O(lg(N))的速度class Solution {public: bool isPowe

2016-01-13 17:48:09 221

转载 欢迎使用CSDN-markdown编辑器

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2016-01-13 17:36:19 172

计算机算法设计与分析

朴老师的算法课答案,非常有用,给中科院的学弟学妹们

2015-03-26

c语言编写的文本编辑器

c语言编写的文本编辑器,好的很。值得信赖啊!哈哈哈哈哈哈

2011-07-12

c语言编写的俄罗斯方块

c语言编写的俄罗斯方块,非常好。能运行,值得下

2011-07-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除