杨领well的专栏

君子食无求饱,居无求安,敏于事而慎于言,就有道而正焉。

排序:
默认
按更新时间
按访问量

STL中的智能指针(Smart Pointer)及其源码剖析: std::unique_ptr

STL中的智能指针(Smart Pointer)及其源码剖析: std::unique_ptr 和 std::auto_ptr一样,std::unique_ptr也是一种智能指针,它也是通过指针的方式来管理对象资源,并且在 unique_ptr 的生命期结束后释放该资源。 unique_ptr ...

2017-02-23 21:58:58

阅读数:11320

评论数:0

STL中的智能指针(Smart Pointer)及其源码剖析: std::auto_ptr

STL中的智能指针(Smart Pointer)及其源码剖析: std::auto_ptr 本文主要介绍了 auto_ptr的使用及其源码。 auto_ptr是STL中的智能指针家族的成员之一, 它管理由new expression获得的对象,在auto_ptr对象销毁时,他所管理的对象也会自...

2017-02-20 12:22:09

阅读数:11636

评论数:0

LeetCode:129. Sum Root to Leaf Numbers

LeetCode:129. Sum Root to Leaf Numbers 题目描述 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. ...

2018-04-17 09:07:29

阅读数:290

评论数:0

LeetCode: 128. Longest Consecutive Sequence

LeetCode: 128. Longest Consecutive Sequence 题目描述 Given an unsorted array of integers, find the length of the longest consecutive elements sequence....

2018-04-16 09:10:14

阅读数:283

评论数:0

LeetCode: 127. Word Ladder

LeetCode: 127. Word Ladder 题目描述 Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation s...

2018-04-12 09:17:03

阅读数:479

评论数:0

LeetCode: 126. Word Ladder II

LeetCode: 126. Word Ladder II 最近工作和毕设压力比较大, 刷 LeetCode 有点不在状态,代码可能有点难看。不过,整体的思路应该是没有问题的。 题目描述 Given two words (beginWord and endWord), and a...

2018-04-11 10:12:42

阅读数:421

评论数:0

LeetCode: 125. Valid Palindrome

LeetCode: 125. Valid Palindrome 题目描述 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. ...

2018-04-08 09:19:46

阅读数:474

评论数:0

LeetCode: 124. Binary Tree Maximum Path Sum

LeetCode: 124. Binary Tree Maximum Path Sum 题目描述 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequ...

2018-04-07 11:17:17

阅读数:467

评论数:0

LeetCode: 123. Best Time to Buy and Sell Stock III

LeetCode: 123. Best Time to Buy and Sell Stock III 题目大意 Say you have an array for which the ith element is the price of a given stock on day i. ...

2018-04-06 09:49:32

阅读数:496

评论数:1

KMP 算法(Knuth–Morris–Pratt algorithm)的基本思想

KMP 算法(Knuth–Morris–Pratt algorithm)的基本思想 阅读本文之前,您最好能够了解 KMP 算法解决的是什么问题,最好能用暴力方式(Brute Force)解决一下该问题。 KMP 算法主要想解决的是文本搜索的问题: 给定一个模式字符串 p 和一个子串 ...

2018-04-05 21:39:08

阅读数:489

评论数:0

LeetCode: 122. Best Time to Buy and Sell Stock II

LeetCode: 122. Best Time to Buy and Sell Stock II 题目描述 Say you have an array for which the ith element is the price of a given stock on day i. D...

2018-04-05 11:24:31

阅读数:475

评论数:0

LeetCode: 121. Best Time to Buy and Sell Stock

LeetCode: 121. Best Time to Buy and Sell Stock 题目描述 Say you have an array for which the ith element is the price of a given stock on day i. If y...

2018-04-05 10:52:19

阅读数:480

评论数:0

LeetCode: 120. Triangle

LeetCode: 120. Triangle 题目描述 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row ...

2018-04-04 09:24:14

阅读数:472

评论数:0

LeetCode: 119. Pascal's Triangle II

LeetCode: 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...

2018-04-03 09:02:36

阅读数:377

评论数:0

LeetCode: 118. Pascal's Triangle

LeetCode: 118. Pascal’s Triangle 题目描述 Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Return [ ...

2018-04-03 08:48:49

阅读数:375

评论数:0

LeetCode: 117. Populating Next Right Pointers in Each Node II

LeetCode: 117. Populating Next Right Pointers in Each Node II 题目描述 Follow up for problem “Populating Next Right Pointers in Each Node”. What if th...

2018-04-02 09:02:04

阅读数:391

评论数:0

LeetCode: 116. Populating Next Right Pointers in Each Node

LeetCode: 116. Populating Next Right Pointers in Each Node 题目描述 Given a binary tree struct TreeLinkNode { TreeLinkNode *left; Tr...

2018-04-01 16:45:18

阅读数:384

评论数:0

LeetCode: 115. Distinct Subsequences

LeetCode: 115. Distinct Subsequences 题目描述 Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subseq...

2018-03-31 09:57:50

阅读数:272

评论数:0

LeetCode: 114. Flatten Binary Tree to Linked List

LeetCode: 114. Flatten Binary Tree to Linked List 题目描述 Given a binary tree, flatten it to a linked list in-place. For example, Given ...

2018-03-30 09:14:14

阅读数:517

评论数:0

LeetCode: 113. Path Sum II

LeetCode: 113. Path Sum II 题目描述 Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For examp...

2018-03-29 09:46:57

阅读数:404

评论数:0

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