上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: STL中的list就是一双向链表,可高效地进行插入删除元素。List是C++标准程式库中的一个类,可以简单视之为双向连结串行,以线性列的方式管理物件集合。list 的特色是在集合的任何位置增加或删除元素都很快,但是不支持随机存取。list 是C++标准程式库提供的众多容器(container)之一,... 阅读全文
posted @ 2015-11-12 21:57 流白 阅读(459) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/range-sum-query-immutable/class NumArray {public: vector vec;public: NumArray(vector &nums) { if(nums.empty())... 阅读全文
posted @ 2015-11-12 19:20 流白 阅读(271) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/word-search/class Solution {public: struct Trie{ Trie *next[57]; bool isWord; Trie() { ... 阅读全文
posted @ 2015-11-10 11:00 流白 阅读(484) 评论(0) 推荐(0) 编辑
摘要: Trie 树模板https://leetcode.com/problems/implement-trie-prefix-tree/class TrieNode {public: char var; bool isWord; TrieNode *next[26]; TrieNo... 阅读全文
posted @ 2015-11-10 10:58 流白 阅读(184) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/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... 阅读全文
posted @ 2015-11-07 12:59 流白 阅读(159) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/largest-rectangle-in-histogram/https://leetcode.com/problems/maximal-rectangle/ 1 class Solution { 2 public: 3 int l... 阅读全文
posted @ 2015-11-06 14:32 流白 阅读(193) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/perfect-squares/Given a positive integern, find the least number of perfect square numbers (for example,1, 4, 9, 16, ...... 阅读全文
posted @ 2015-11-02 14:11 流白 阅读(291) 评论(1) 推荐(0) 编辑
摘要: https://leetcode.com/problems/intersection-of-two-linked-lists/Write a program to find the node at which the intersection of two singly linked lists b... 阅读全文
posted @ 2015-11-01 15:38 流白 阅读(204) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/minimum-size-subarray-sum/Given an array ofnpositive integers and a positive integers, find the minimal length of a suba... 阅读全文
posted @ 2015-11-01 15:19 流白 阅读(159) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/generate-parentheses/Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthe... 阅读全文
posted @ 2015-10-28 10:00 流白 阅读(825) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页