当前搜索:

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

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

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

STL中的智能指针(Smart Pointer)及其源码剖析: std::auto_ptr 本文主要介绍了 auto_ptr的使用及其源码。 auto_ptr是STL中的智能指针家族的成员之一, 它管理由new expression获得的对象,在auto_ptr对象销毁时,他所管理的对象也会自...
阅读(11488) 评论(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. ...
阅读(286) 评论(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....
阅读(279) 评论(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...
阅读(474) 评论(0)

LeetCode: 126. Word Ladder II

LeetCode: 126. Word Ladder II 最近工作和毕设压力比较大, 刷 LeetCode 有点不在状态,代码可能有点难看。不过,整体的思路应该是没有问题的。 题目描述 Given two words (beginWord and endWord), and a...
阅读(419) 评论(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. ...
阅读(471) 评论(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...
阅读(466) 评论(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. ...
阅读(489) 评论(1)

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

KMP 算法(Knuth–Morris–Pratt algorithm)的基本思想 阅读本文之前,您最好能够了解 KMP 算法解决的是什么问题,最好能用暴力方式(Brute Force)解决一下该问题。 KMP 算法主要想解决的是文本搜索的问题: 给定一个模式字符串 p 和一个子串 ...
阅读(485) 评论(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...
阅读(473) 评论(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...
阅读(477) 评论(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 ...
阅读(471) 评论(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...
阅读(375) 评论(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 [ ...
阅读(374) 评论(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...
阅读(389) 评论(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...
阅读(382) 评论(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...
阅读(267) 评论(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 ...
阅读(516) 评论(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...
阅读(403) 评论(0)
    个人资料
    持之以恒
    等级:
    访问量: 35万+
    积分: 2940
    排名: 1万+
    友情链接
    最新评论