c++
文章平均质量分 53
sinat_26722849
我我
展开
-
BFS寻路算法 c++
#include <iostream>#include <vector>#include <queue>#include <algorithm> using namespace std;struct Node { int x; int y;};class Solution {public: vector<Node> shortestPathBinaryMatrix(vector<vector<.原创 2020-08-29 21:22:25 · 280 阅读 · 0 评论 -
leetcode 4. Median of Two Sorted Arrays (c++)
思路中位数为两个数组顺序合并后第(m+n+1)/2, (m+n+2)/2个数的均值该题思路转变为,求两个以排序数组的第k位数,定义i,j分别为两个数组的起始位该函数为递归函数,递归思路为,反之也是如此代码如下 int findKth(vector<int>& nums1, int i, vector<int>& num...原创 2019-11-27 11:17:02 · 117 阅读 · 0 评论 -
leetcode 3. Longest Substring Without Repeating Characters (c++)
思路定义一个hashset,两个指针分别指向子串的首尾,hashset存放指针内字符class Solution {public: int lengthOfLongestSubstring(string s) { int start_pointer=0; int end_pointer=0; int output=0; ...原创 2019-11-23 19:44:24 · 117 阅读 · 0 评论 -
leetcode 2. Add Two Numbers (c++)
思路同时遍历两个链表,顺序加和进位/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {...原创 2019-11-21 14:54:44 · 147 阅读 · 0 评论 -
leetcode 1. Two Sum (c++)
思路先排序,在查找class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { vector<pair<int,int>> total; for(int i=0;i<nums.size();...原创 2019-11-20 15:07:19 · 146 阅读 · 0 评论 -
技术面试总结(一)
cisco (software engineer):一面死锁产生原因,具体如何破坏? static_cast和dynamic_cast区别? new对象如何保证释放?(智能指针),哪一个智能指针? 算法题,一个乱序数组(0~100以内),通过排序实现,前段0~60,后段60~100? python和c++区别? 快排,归并排序,时间复杂度,最坏时间复杂度? hash表查询,时间复杂...原创 2019-11-08 20:24:37 · 190 阅读 · 0 评论 -
opencv教程(五)c++
opencv教程(五)行驶车辆识别c++Blob.h#ifndef BLOB_H //先测试BLOB_H是否被宏定义过#define BLOB_H //如果x没有被宏定义过,定义x,并编译程序段#include<opencv2/core/core.hpp>#include<opencv2/imgproc/imgproc.hpp>#include<opencv2/highgui/highg原创 2017-07-15 23:24:32 · 1999 阅读 · 1 评论 -
opencv教程(四)c++
opencv教程(四)凸包检测c++凸包(Convex Hull)是一个计算几何图形学中的概念,在二维欧几里得空间中,凸包可想象为一条刚好包住所有点的橡皮圈。 对于给定二维平面上的点集,凸包就是将最外层的点连接起来构成的凸多边形。物体的凸包检测常常应用在物体识别,手势识别及边界检测等领域。 C++: void convexHull(InputArray points, OutputArray h原创 2017-07-15 18:26:33 · 1035 阅读 · 0 评论 -
opencv教程(三)c++
opencv教程(三)轮廓检测c++边缘检测函数 1)c++:void findContours( InputOutputArray image, OutputArrayOfArrays contours,int mode, int method, Point offset = Point()); 2)c++:void findContours( InputOutputArray image,原创 2017-07-15 15:28:17 · 4337 阅读 · 0 评论 -
opencv教程(二)c++
opencv教程(二)c++视频处理 VideoCapture类常用的函数 VideoCapture::open 打开视频文件或视频获取装置 VideoCapture::isOpened 判断视频文件读取是否正确,返回true则正确 VideoCapture::release 关闭视频流文件 VideoCapture::grab 抓住下一帧的视频文件或捕获设备 VideoCa原创 2017-07-14 16:29:43 · 821 阅读 · 0 评论 -
opencv人脸识别(c++)
opencv人脸识别(c++)配置环境 opencv3.1+vs2013 配置方法 How to install OpenCV 3.1 with visual studio 2013新建faceredetect.cpp,并把图片(obama.jpg)和haarcascade_frontalface_alt2.xml(或者haarcascade_frontalface_alt.xml)放在cpp原创 2017-07-12 10:40:06 · 2753 阅读 · 0 评论 -
opencv教程(一)(c++)
opencv教程3.1.0(一)(c++)opencv包含以下几个模块,每个模块中包含一些共享或者静态的库 1.core:一个定义基本数据结构的模块,包括密集的多维数组Mat和所有其他模块使用的基本功能。 2.Image processing:包括线性和非线性图像滤波,几何图像变换(调整大小,仿射和透视扭曲,通用的基于表的重新映射),色彩空间转换,直方图等的图像处理模块。 3.video:视频翻译 2017-07-12 16:27:22 · 5823 阅读 · 1 评论