自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

风顺水流

never stop.

  • 博客(58)
  • 收藏
  • 关注

转载 AngularJS-2.依赖注入

AngularJS的一个强大之处就在于依赖注入。在调用bootstrap的时候,会调用createInjector来创建一个注射器进行注入。该方法的代码简化如下:function createInjector(modulesToLoad, strictDi) { strictDi = (strictDi === true); var INSTANTIATING = {},

2016-09-06 10:29:00 1019

转载 AngularJS-1.启动流程

整体结构bindJQuerypublishExternalAPIangularInit应用启动自动启动手动启动细节问题整体结构AngularJS的源码在整体上,与其它很多库和框架一样,是一个自执行函数,其整体结构简化如下:(function(window, document, undefined) { if (window.angular.bootstrap) {//判断是否已经

2016-09-02 17:16:14 2239

转载 常见http状态码

常见http状态码成功的状态码: 200 – 服务器成功返回网页 304 – 未修改 失败的状态码: 404 – 请求的网页不存在 503 – 服务器暂时不可用 500 – 服务器内部错误

2016-09-02 14:08:20 298

原创 LintCode-剑指Offer-(83)落单的数 II

**class Solution {public: /** * @param A : An integer array * @return : An integer */ int singleNumberII(vector &A) { // write your code here map

2015-12-05 14:25:16 455

原创 LintCode-剑指Offer-(71)二叉树的锯齿形层次遍历

class Solution { /** * @param root: The root of binary tree. * @return: A list of lists of integer include * the zigzag level order traversal of its nodes' values */public

2015-12-05 13:40:10 475

原创 LintCode-剑指Offer-(50)数组剔除元素后的乘积

class Solution {public: /** * @param A: Given an integers array A * @return: A long long array B and B[i]= A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1] */ vector<long long> productE

2015-12-05 13:04:50 250

原创 LintCode-剑指Offer-(112)删除排序链表中的重复元素

class Solution {public: /** * @param head: The first node of linked list. * @return: head node */ ListNode *deleteDuplicates(ListNode *head) { // write your code here

2015-12-05 12:56:30 344

原创 LintCode-剑指Offer-(54)转换字符串到整数

class Solution {public: /** * @param str: A string * @return An integer */ int atoi(string str) { // write your code here int sum=0; int i = str.length()-1;

2015-12-05 12:51:06 231

原创 LintCode-剑指Offer-(88)最近公共祖先

class Solution {public: /** * @param root: The root of the binary search tree. * @param A and B: two nodes in a Binary. * @return: Return the least common ancestor(LCA) of the two node

2015-12-05 12:30:59 354

原创 LintCode-剑指Offer-(56)两数之和

class Solution {public: /* * @param numbers : An array of Integer * @param target : target = numbers[index1] + numbers[index2] * @return : [index1+1, index2+1] (index1 < index2) */

2015-12-05 10:09:08 277

原创 LintCode-剑指Offer-(61)搜索区间

class Solution { /** *@param A : an integer sorted array *@param target : an integer to be inserted *return : a list of length 2, [index1, index2] */public: vector<int> search

2015-12-05 10:05:37 309

原创 LintCode-剑指Offer-(1)A+B问题

class Solution {public: /* * @param a: The first integer * @param b: The second integer * @return: The sum of a and b */ int aplusb(int a, int b) { // write your co

2015-12-05 09:59:08 275

原创 LintCode-剑指Offer-(8)旋转字符

class Solution {public: /** * @param str: a string * @param offset: an integer * @return: nothing */ void rotateString(string &str,int offset){ //wirte your code here

2015-12-05 09:56:56 225

原创 LintCode-剑指Offer-(53)翻转字符串

void split(std::string& s,std::string& delim,std::vector< std::string >* ret){ size_t last = 0; size_t index = s.find_first_of(delim,last); while (index!=std::string::npos) { r

2015-12-05 09:49:13 390

原创 LintCode-剑指Offer-(82)落单的数

class Solution {public: /** * @param A: Array of integers. * return: The single number. */ int singleNumber(vector<int> &A) { // write your code here int n=0;

2015-12-05 09:34:15 295

原创 LintCode-剑指Offer-(97)二叉树的最大深度

/** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->val = val; * this->left = this->right =

2015-12-05 09:31:48 258

原创 LintCode-剑指Offer-(3)统计数字

class Solution {public: /* * param k : As description. * param n : As description. * return: How many k's between 0 and n. */ int countint(int k,int n){ int num = 0;

2015-12-05 09:23:40 601

原创 LintCode-剑指Offer-(4)丑数

class Solution {public: /* * @param k: The number k. * @return: The kth prime number as description. */ long long Min(long long i,long long j,long long k){ return min(i

2015-12-04 10:37:56 344

原创 LintCode-剑指Offer-(5)第k大元素

class Solution {public: /* * param k : description of k * param nums : description of array and index 0 ~ n-1 * return: description of return */ int kthLargestElement(int k,vec

2015-12-04 08:40:25 428

原创 LintCode-剑指Offer-(381)数倒置

vector<vector<int>> generateMatrix(const int n) { // Write your code here bool **IsVisited; IsVisited = new bool*[n]; vector<vector<int>> v; if (n==0)return v;

2015-12-04 08:33:47 630

原创 LintCode-剑指Offer-(380)两个链表的交叉

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: /** * @pa

2015-11-29 17:01:53 562

原创 LintCode-剑指Offer-(41)最大子数组

class Solution {public: /** * @param nums: A list of integers * @return: A integer indicate the sum of max subarray */ int maxSubArray(vector<int> nums) { // write your cod

2015-11-29 16:47:48 335

原创 LintCode-剑指Offer-(46)主元素

class Solution {public: /** * @param nums: A list of integers * @return: The majority number */ int majorityNumber(vector<int> nums) { // write your code here int n

2015-11-29 14:24:03 368

原创 LintCode-剑指Offer-(378)将二叉查找树转换成双链表

class Solution {public: /** * @param root: The root of tree * @return: the head of doubly list node */ DoublyListNode* bstToDoublyList(TreeNode* root) { // Write your code

2015-11-29 14:18:00 2171

原创 LintCode-剑指Offer-(374)螺旋矩阵

class Solution {public: /** * @param matrix a matrix of m x n elements * @return an integer array */ vector<int> spiralOrder(vector<vector<int>>& matrix) { // Write your co

2015-11-29 13:22:59 933

原创 LintCode-剑指Offer-(376)二叉树路径求和

/** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->val = val; * this->left = this->right =

2015-11-29 12:27:48 417

原创 LintCode-剑指Offer-(105)复制带随机指针的链表

class Solution {public: /** * @param head: The head of linked list with a random pointer. * @return: A new head of a deep copy of the list. */ //递归真是个好东西,没想到真能用一个变量实现,简洁明了啊,非常好。

2015-11-22 02:25:50 1542

原创 LintCode-剑指Offer-(12)带最小值操作的栈

class MinStack {public: MinStack() { // do initialization if necessary } stack<int> s; stack<int> minstack; int minnum; void push(int number) { // write your co

2015-11-22 01:22:11 266

原创 LintCode-剑指Offer-(70)二叉树的层次遍历Ⅱ

class Solution { /** * @param root: The root of binary tree. * @return: Level order a list of lists of integer */ public: void lev(TreeNode* node, int levelnum, vector

2015-11-22 01:03:42 351

原创 LintCode-剑指Offer-(69)二叉树的层次遍历

class Solution { /** * @param root: The root of binary tree. * @return: Level order a list of lists of integer */public: void lev(TreeNode* node, int levelnum, vector<vector<int>>&

2015-11-22 01:00:56 271

原创 LintCode-剑指Offer-(68)二叉树的后序遍历

/** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->val = val; * this->left = this->right =

2015-11-22 00:05:59 276

原创 LintCode-剑指Offer-(140)快速幂

class Solution {public: /* * @param a, b, n: 32bit integers * @return: An integer */ //要用long long类型,不然可能溢出 long long fastPower(long long a, long long b, long long n) {

2015-11-22 00:00:07 457

原创 LintCode-剑指Offer-(371)用递归打印数字

class Solution {public: /** * @param n: An integer. * return : An array storing 1 to the largest number with n digits. */ vector<int> numbersByRecursion(int n) { //我感觉这道题有点显得

2015-11-21 22:48:03 552

原创 LintCode-剑指Offer-(165)合并两个排序链表

class Solution {public: /** * @param ListNode l1 is the head of the linked list * @param ListNode l2 is the head of the linked list * @return: ListNode head of linked list */ L

2015-11-21 22:24:29 378

原创 LintCode-剑指Offer-(174)删除链表中倒数第n个节点

/** * Definition of ListNode * class ListNode { * public: * int val; * ListNode *next; * ListNode(int val) { * this->val = val; * this->next = NULL; * } * } *

2015-11-21 20:43:53 256

原创 LintCode-剑指Offer-(245)子树

class Solution {public: /** * @param T1, T2: The roots of binary tree. * @return: True if T2 is a subtree of T1, or false. */ bool isSubtree(TreeNode *T1, TreeNode *T2) { if

2015-11-21 20:29:12 275

原创 LintCode-剑指Offer-(372)在O(1)时间复杂度删除链表节点

/** * Definition of ListNode * class ListNode { * public: * int val; * ListNode *next; * ListNode(int val) { * this->val = val; * this->next = NULL; * } * } *

2015-11-21 17:44:14 295

原创 LintCode-剑指Offer-(373)奇偶分割数组

class Solution {public: /** * @param nums: a vector of integers * @return: nothing */ void partitionArray(vector<int> &nums) { // write your code here int i=0;

2015-11-21 17:32:17 861

原创 LintCode-剑指Offer-(73)前序遍历和中序遍历树构造二叉树

class Solution { /**' * ' *@param preorder : A list of integers that preorder traversal of a tree *@param inorder : A list of integers that inorder traversal of a tree *@return : Ro

2015-11-21 17:05:29 307

原创 LintCode-剑指Offer-(160)寻找旋转排序数组中的最小值Ⅱ

class Solution {public: /** * @param num: the rotated sorted array * @return: the minimum number in the array */ int findMin(vector<int> &num) { // write your code here

2015-11-21 01:51:58 268

空空如也

空空如也

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

TA关注的人

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