- 博客(8)
- 资源 (9)
- 收藏
- 关注
转载 C++中的STL中map用法详解
Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据 处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一 种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能,所以在map内部所有的数据都是有序的,后边我们会见识...
2018-03-29 19:18:43 117
原创 344. Reverse String
Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".解题思路:字符串翻转,字符交换class Solution {public: string reverseString(string s) { ...
2018-03-21 16:37:14 111
原创 476. Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range of a 32-bi...
2018-03-21 15:54:26 123
原创 796. Rotate String
We are given two strings, A and B.A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one s...
2018-03-20 21:34:38 109
原创 561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as poss...
2018-03-20 20:54:19 88
原创 728. Self Dividing Numbers
A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.Also, a self-div
2018-03-20 15:45:08 91
原创 617. Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree. ...
2018-03-20 14:35:33 95
原创 npm 内存溢出
解决办法:package.json的scipt添加 "prod": "node --max-old-space-size=4096"
2018-03-08 15:53:32 5575
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人