- 博客(45)
- 资源 (8)
- 收藏
- 关注
原创 ALDS1_10_C Longest Common Subsequence
#include <iostream>#include <string>#include <algorithm>using namespace std;static const int N = 1000;int lcs (string x, string y) { int m = x.size(); int n = y.size...
2019-04-17 11:40:06 505
原创 Quick Sort (C++)
#include <iostream> #include <vector>using namespace std;int partition(vector<int>& num, int first, int last) { int k = first; int ntemp = num[last]; //这里设置...
2019-04-16 16:07:46 683
原创 字符串分隔
链接:https://www.nowcoder.com/questionTerminal/d9162298cb5a437aad722fccccaae8a7来源:牛客网#include <iostream>#include <string>using namespace std;void fuck(string str) { if (st...
2019-04-03 16:18:06 633
原创 背包问题
01背包 完全背包 多重背包01背包有N件物品和一个容量为C的背包。 第i件物品的 重量为 c[i] , 价值为 v[i]。 求解将哪些物品装入背包可使价值总和最大。思路: 将前i件物品放入容量为C的背包中, 若只考虑第i件物品的策略 (放或者不放), 那么就可以转化为 一个只 牵扯 前 i-1 件物品的问题。定义状态: f[i][C] = max{f[i - 1][C], f[...
2019-04-03 09:38:52 532
原创 二叉树的重建
class Solution {public: struct TreeNode* reConstructBinaryTree(vector<int> pre, vector<int> in) { int inlen = in.size(); if (inlen == 0) return NULL; vector<int> le...
2019-03-26 10:38:31 450
原创 剑指offer ——顺时针打印矩阵
class Solution {public: vector<int> printMatrix(vector<vector<int> > matrix) { int rows = matrix.size(); int cols = matrix[0].size(); vector<int> result; if (cols ==...
2019-03-20 10:45:44 357
原创 剑指offer ——删除链表中重复的节点
解法:在重新定义链表指针域的同时, 使用 delete 释放了已删除节点的内存空间。class Solution {public: ListNode* deleteDuplication(ListNode* pHead) { if (pHead == nullptr || pHead->next == nullptr) { //平凡列表无重复,确保列表...
2019-03-15 17:06:13 387
原创 剑指offer 面试题9: 用两个栈实现队列
class Solution{public: void push(int node) { stack1.push(node); } int pop() { if (stack2.empty()) { while (!stack1.empty()) { stack2.push(stack1.top()); stack1.pop(); } //i...
2019-03-11 09:27:16 401
原创 二叉树的遍历 (C++实现)
本文涉及三种常见的遍历方式 : 先序遍历、中序遍历、后序遍历,以及用C++实现的非递归版本代码。首先我们定义一下二叉树结点类struct BinaryTreeNode { int val; BinaryTreeNode* leftchild; BinaryTreeNode* rightchild; BinaryTreeNode(int const& _val, Bina...
2019-03-06 22:05:28 30843 4
转载 c_str()
转载于:https://blog.csdn.net/chaipp0607/article/details/75371149atoi()是C语言中的字符串转换成整型数的一个函数,在例子的代码里面会用到,其函数原型为:int atoi(const char *nptr);下面是一个C语言的代码,可以正常运行:#include <stdio.h>#include &l...
2019-03-04 10:15:36 3006
原创 C++11 多线程 ——detach、join
#include <iostream>#include <thread>void function_1() { std::cout << "I'm function_1()" << std::endl;}int main() { std::thread t1(function_1); // do other th...
2019-03-03 10:54:04 1046
转载 C++ main函数中参数argc和argv含义及用法
本文转载于:https://blog.csdn.net/dcrmg/article/details/51987413argc 是 argument count的缩写,表示传入main函数的参数个数;argv 是 argument vector的缩写,表示传入main函数的参数序列或指针,并且第一个参数argv[0]一定是程序的名称,并且包含了程序所在的完整路径,所以确切的说需要我们输入的m...
2019-02-25 15:30:21 754
原创 Function Pointer
这篇一看就懂 https://www.learncpp.com/cpp-tutorial/78-function-pointers/
2019-01-22 16:34:32 377
原创 pointer to pointer/reference to pointer
When we use "pass by pointer" to pass a pointer to a function, only a copy of the pointer is passed to the function. We can say "pass by pointer" is passing a pointer by value. In most cases, th...
2019-01-20 11:26:55 708
原创 数据结构——列表
1.列表节点ADT接口操作接口 功能 data() 当前节点所存数据对象 pred() 当前节点前驱节点的位置 succ() 当前节点后继节点的位置 insertAsPred(e) 插入前驱节点,存入被引用对象e,返回新节点位置 insertAsSucc(e) 插入后继节点,存入被引用对象e,返回新节点位置 typedef int ...
2019-01-17 09:23:15 1552
原创 数据结构————队列
1.ADT接口 操作 功能 size() 报告队列的规模(元素总数) empty() 判断队列是否为空 enqueue(e) 将e插入队尾 dequeue() 删除队首对象 front() 引用队首对象 ...
2019-01-15 17:42:40 454
原创 数据结构————栈
1.ADT接口操作接口 功能 empty() 判断栈是否为空 size() 报告栈的规模 push(e) 将e插至栈顶 pop() 删除栈顶对象 top() 引用栈顶对象
2019-01-15 17:16:54 392
原创 数据结构——向量
1.ADT支持的操作接口 操作接口 功能 适用对象 size() 报告向量当前的规模(元素总数) 向量 get(r) 获取秩为r的元素 向量 put(r, e) 用e替换秩为r元素的值 向量 insert(r, e) e作为秩为r元素插入,原后继元素依次后移 向量 remove(r) 删除秩为r的元...
2019-01-10 18:48:38 1862
转载 常函数
转自 :https://blog.csdn.net/shixiaoguo90/article/details/25658059 类的成员函数后面加 const,表明这个函数不会对这个类对象的数据成员(准确地说是非静态数据成员)作任何改变。 在设计类的时候,一个原则就是对于不改变数据成员的成员函数都要在后面加 const,而对于改变数据成员的成员函数不能加 const。所以 con...
2019-01-10 15:08:23 6497
原创 数据结构与算法书目
要补基础了,大概浏览了以下四本书:数据结构与算法分析 C++语言描述 4th 这本书内容不错...但是这个翻译水平是我见过最烂的...看原版吧这本。算法导论 数学推导比较多,伪代码实现, 感觉应该在阅读其他书籍入门后再来看大话数据结构 C语言描述,代码质量不行... 厕所读物 可看可不看邓俊辉 数据结构 (C++语言版) 比较了上面几本书之后,发现这本是真不错,配合习...
2019-01-10 09:32:08 360
原创 Performance metrics of place recognition
The performance of the place recognition algorithm is typically evaluated according to precision, recall metrics, and precision-recall curve. The matches consistent with the ground truth are re- ...
2019-01-04 09:47:35 361
原创 DPI与PPI
详细信息请阅读 点击这里PPI:Think of the PPI input as a way to adjust the physical size – not the resolution – of the eventual print-out. Decreasing the PPI, thus increasing the size of the printout, may seem...
2019-01-02 19:13:01 835
原创 InternalError: GPU sync failed
在jupyter notebook中用gpu跑神经网络时遇到这个问题,解决方法,重启ipython notebook即可。难道因为开了太多python kernel导致gpu资源分配不处来了? 嗯...这应该是jupyter notebook特有的问题吧。...
2018-12-27 14:26:43 12343 4
原创 AttributeError: '_NamespacePath' object has no attribute 'sort
在使用from keras import optimizers时出现该错误修正方法:wget https://bootstrap.pypa.io/ez_setup.py -O - | python
2018-12-26 09:21:30 1832 1
原创 AttributeError: 'module' object has no attribute 'to_rgba'
import matplotlib.pyplot as pltimport numpy as npx = np.arange(20)y = x**2plt.plot(x, y)在jupyter notebook中使用matplotlib画图出现这个错误,修正方法:sudo pip install matplotlib==2.2.0 ...
2018-12-26 08:46:53 2234
原创 cv::FileStorage
参考链接:https://blog.csdn.net/wonder233/article/details/52810458 https://blog.csdn.net/coma_6512/article/details/78232649成员函数operator <<FileStorage::openFileStorage::isOp...
2018-12-05 09:04:57 6484
原创 slam十四讲g2o问题
1. 3d2d程序的CMakeLists.txt写法cmake_minimum_required(VERSION 2.8)project(features)set(CMAKE_CXX_FLAGS "-std=c++11")list( APPEND CMAKE_MODULE_PATH /home/zhhp/g2o/cmake_modules )find_package(OpenCV ...
2018-11-20 18:35:48 1248
原创 Undefined reference to symbol '_ZN5boost6system15system_categoryEv'
在编译orb-slam2 的examples时 rgbd stero总是 failed解决:https://github.com/raulmur/ORB_SLAM2/issues/494 就改这里就行了I only put -lboost_system inside set(LIBS...) Could show us the error? And your CMakeLis...
2018-11-14 11:27:27 1797
原创 Ubuntu16.04 ros-kinetic下安装kinect驱动
环境:独显gtx1050ti 已安装Nvidia-390显卡驱动OS: Ubuntu 16.04.5 LTS x64ROS Distro: KineticMachine: HP-OMEN 暗影精灵4 这篇博客的起因是 roslaunch openni_launch openni.launch 后出现错误:... logging to /home/zhhp/.ros/l...
2018-11-13 09:37:04 1967 3
原创 catkin_make与cmake
catkin_make 实际和下面的指令是等效的$ cd ~/catkin_ws$ cd src$ catkin_init_workspace$ cd ..$ mkdir build$ cd build$ cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_PREFIX=../devel$ make ...
2018-11-07 14:15:16 716
原创 UEFI引导ubuntu16.04 的Nvidia显卡驱动安装
参考原文:https://blog.csdn.net/sizaif/article/details/79399130 写在前面:我用的是Ubuntu16.04.5版本(官网下载)笔记本是暗影精灵4, nvidia显卡为1050ti 因为笔记本型号很新,所以4.10以前的内核版本都不能很好的驱动硬件,为了让笔记本的性能发挥出来我决定安装新内核版本的Ubuntu系统(其实最开始是因为...
2018-11-03 11:53:55 4173 2
原创 RGBD SLAM V2 环境搭建
我的环境是ubuntu14.04 + ROS indigoopencv 2.4.11 编译安装完opencv后注意要配置一下在GitHub上下载某个特定版本的源码时 选择你要的branch,然后 download zip在主文件夹下建立一个 myslam文件夹,把相关包都放在这里 安装包的过程cd到目录下mkdir buildcd buildcm...
2018-08-17 09:37:35 449
原创 Ubuntu升级git版本
安装了VSCode,提示我git版本需要升级。步骤如下# To get the very latest version of git, you need to add the PPA (Personal Package Archive) from the Ubuntu Git Maintainers Team to your Software Source list. Do that with t...
2018-07-05 16:38:44 1198
原创 从零开始的ORB-SLAM2生活
在http://vision.in.tum.de/data/datasets/rgbd-dataset/download上下载并解压好数据集后 cd到数据集的目录,mv rgbd_dataset_freiburg1_xyz /usr/slam_tools然后进入ORB_SLAM2目录sudo ./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt ...
2018-07-02 20:45:37 3105 12
原创 Ubuntu14.04 安装intel无线网卡驱动(含升级内核)
新安装的14.04 没有无线网卡驱动,我在win10下看到网卡型号是 intel的9560, 在intel官网看到9560驱动需要 kernel的 版本 是4.14+ https://www.intel.com/content/www/us/en/support/articles/000005511/network-and-i-o/wireless-networking.ht...
2018-07-01 20:28:25 8706 8
原创 UEFI模式 在 GPT双硬盘上安装 win10 + ubuntu双系统
笔记本型号:暗影精灵4(固态+机械硬盘)固态硬盘安装win10(用微软官方工具安装)机械硬盘安装ubuntu14.04我的笔记本硬盘是GPT的,而百度出来的装双系统的方法大多是MBR的硬盘,所以走了很多坑。这里把需要注意的事情简单贴出来,以便有需要时查阅。一、安装Ubuntu1.设置bios 关闭secure boot (fast boot 实际上不需要关,对双系统没有影响)2.在机械硬盘上划...
2018-07-01 20:02:37 4383 2
原创 编译opencv cmke报错
编译opencv时 若 cmake . 命令报错 You should create a separate directory for build files.解决方法:1.删除Cmake Cache.txt(名字可能记错了) 2.创建一个build目录 , 在此目录下 make .. 即可完成编译。...
2018-05-01 15:10:21 1170
计算机科学精粹
2019-01-25
程序员的数学(全三册)
2019-01-04
Use R!系列教程
2018-01-13
数据库系统概念(原书第六版带书签)带书签
2018-01-13
OpenCV3+Qt5视频处理GUI程序
2018-01-10
程序员跳槽全攻略
2018-01-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人