
c++
Vera小白
模式识别入门
展开
-
Merge Two Binary Trees
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 i原创 2017-07-11 15:30:13 · 280 阅读 · 0 评论 -
Array Partition I
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原创 2017-07-12 10:56:04 · 424 阅读 · 0 评论 -
476. Number Complement
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原创 2017-07-12 11:28:09 · 294 阅读 · 0 评论 -
Average of Levels in Binary Tree
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]**Explanation原创 2017-07-13 11:23:48 · 392 阅读 · 0 评论 -
Hamming Distance
开始刷LeetCode,逐步学习c++,从最简单的题目开始做: Hamming Distance: The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calcul原创 2017-07-10 09:37:07 · 347 阅读 · 0 评论 -
OpenCV中Mat属性step,size,step1,elemSize,elemSize1
Mat的step,size,step1,elemSize,elemSize1这几个属性非常容易混淆。 OpenCV的官方参考手册也没有解释清楚这几个概念。前一段时间研究了一下每个属性的含义,如果有什么错误,欢迎大家指正。step1(i):每一维元素的通道数step[i]:每一维元素的大小,单位字节size[i]:每一维元素的个数elemSize():每个元素大小,单位字节elemSize1():每个转载 2017-08-16 10:03:36 · 503 阅读 · 0 评论 -
C++ iterator用法
迭代器(iterator)是一中检查容器内元素并遍历元素的数据类型。 (1) 每种容器类型都定义了自己的迭代器类型,如vector: vector::iterator iter;这条语句定义了一个名为iter的变量,它的数据类型是由vector定义的iterator类型。(2) 使用迭代器读取vector中的每一个元素:vector<int> ivec(10,1);for(vector<int转载 2017-08-16 08:55:10 · 2845 阅读 · 1 评论 -
c++崩溃问题汇总
一、前言从事自动化测试平台开发的编程实践中,遭遇了几个程序崩溃问题,解决它们颇费了不少心思,解决过程中的曲折和彻夜的辗转反侧却历历在目,一直寻思写点东西,为这段难忘的经历留点纪念,总结惨痛的教训带来的经验,以期通过自己的经历为他人和自己带来福祉:写出更高质量的程序; 由于 C 和 C++ 这两种语言血缘非常近,文本亦对 C 编程语言有借鉴作用; 二、C++ 崩溃分类一切的偶然并非偶然在转载 2017-08-24 10:56:53 · 935 阅读 · 0 评论