C++实现LeetCode(两个有序数组的中位数)

[LeetCode] 4. Median of Two Sorted Arrays 两个有序数组的中位数There are two sorted arrays nums1 and nums2 of size m and n respectively.Find...

2021-08-09

C++实现LeetCode(131.拆分回文串)

[LeetCode] 131.Palindrome Partitioning 拆分回文串Given a string s, partition s such that every substring of the partition is a palindrome.Return...

2021-08-09

C++实现LeetCode(7.翻转整数)

[LeetCode] 7. Reverse Integer 翻转整数Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123
Output: 321Example 2:Input: -123
Output:...

2021-08-09

C++中nullptr 和 NULL 的区别及用法

1. 为什么会有nullptr的出现目的:nullptr的出现主要是为了替代NULL。那么,为什么要替代NULL呢?在NULL的定义中存在会有2种方式,有的编译器会将NULL定义成0,有的编译器会将NULL定...

2021-08-09

C++实现LeetCode(31.下一个排列)

[LeetCode] 31. Next Permutation 下一个排列Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbe...

2021-08-09

C++实现KDTree 附完整代码

目录简介举例分割的作用一维二维n维关于kdtree的重要问题一.树的建立关键代码简介  k-d树(k-dimensional),是一种分割k维数据空间的数据结构(对数据点在k维空间中划...

2021-08-09

C++实现LeetCode(22.生成括号)

[LeetCode] 22. Generate Parentheses 生成括号Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For...

2021-08-09

C++实现LeetCode(769.可排序的最大块数)

[LeetCode] 769.Max Chunks To Make Sorted 可排序的最大块数Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the ar...

2021-08-09

深入学习C++智能指针之shared_ptr与右值引用的方法

目录1. 介绍2. 初始化方法2.1 通过构造函数初始化2.2 通过拷贝和移动构造函数初始化2.3 通过 std::make_shared 初始化2.4 通过 reset 方法初始化3. 获取原始指针4. 指定删...

2021-08-09

C++高并发内存池的整体设计和实现思路

目录一、整体设计1、需求分析2、总体设计思路3、申请内存流程图二、详细设计1、各个模块内部结构详细剖析2、设计细节三、测试一、整体设计1、需求分析池化技术是计算机中的...

2021-08-09

C++实现LeetCode(20.验证括号)

[LeetCode] 20. Valid Parentheses 验证括号Given a string containing just the characters '(', ')', '{', '}', '[' and ']', deter...

2021-08-09

C++内存池的简单实现

目录一、内存池基础知识1、什么是内存池1.1 池化技术1.2 内存池2、内存池的作用2.1 效率问题2.2 内存碎片3、内存池技术的演进二、简易内存池原理1、整体设计1.1 内存池结构...

2021-08-09

C与汇编混合编程的实现示例

目录1. C语言内联汇编2. C语言调用汇编函数3. 汇编代码调用C语言函数上一期中,使用链表的方式进行对不同任务的调用,实现的效果还是不错的,但是,任务在进行过程中不能进行来回的...

2021-08-09

C++实现LeetCode(25.每k个一组翻转链表)

[LeetCode] 25. Reverse Nodes in k-Group 每k个一组翻转链表Given a linked list, reverse the nodes of a linked list k at a time and return its modified l...

2021-08-09

C++实现LeetCode(28.实现strStr()函数)

[LeetCode] 28. Implement strStr() 实现strStr()函数Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if nee...

2021-08-09

C++实现LeetCode(84.直方图中最大的矩形)

[LeetCode] 84. Largest Rectangle in Histogram 直方图中最大的矩形Given n non-negative integers representing the histogram's bar height where the width...

2021-08-09

C++中单调栈的基本性质介绍

单调栈的定义:单调栈就是栈内元素单调递增或者单调递减的栈,单调栈只能在栈顶操作。为了更好的理解单调栈,则可将单调栈用生活情形模拟实现,例如:我们借用拿号排队的场景来说明下...

2021-08-09

C++实现LeetCode(55.跳跃游戏)

[LeetCode] 55. Jump Game 跳跃游戏Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array...

2021-08-09

C++实现LeetCode(14.最长共同前缀)

[LeetCode] 14. Longest Common Prefix 最长共同前缀Write a function to find the longest common prefix string amongst an array of strings.If there is no common pre...

2021-08-09

C++实现LeetCode(18.四数之和)

[LeetCode] 18. 4Sum 四数之和Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadrup...

2021-08-09

C++实现LeetCode(19.移除链表倒数第N个节点)

[LeetCode] 19. Remove Nth Node From End of List 移除链表倒数第N个节点Given a linked list, remove the nth node from the end of list and return its head.For examp...

2021-08-09

C++实现LeetCode(21.混合插入有序链表)

[LeetCode] 21. Merge Two Sorted Lists 混合插入有序链表Merge two sorted linked lists and return it as a new list. The new list should be made by splicing togethe...

2021-08-09

C++实现LeetCode(24.成对交换节点)

[LeetCode] 24. Swap Nodes in Pairs 成对交换节点Given a linked list, swap every two adjacent nodes and return its head.You may not modify the valu...

2021-08-09

C++实现LeetCode(26.有序数组中去除重复项)

[LeetCode] 26. Remove Duplicates from Sorted Array 有序数组中去除重复项Given a sorted array nums, remove the duplicates in-place such that each e...

2021-08-09

C++实现LeetCode(29.两数相除)

[LeetCode] 29. Divide Two Integers 两数相除Given two integers dividend and divisor, divide two integers without using multiplication, division an...

2021-08-09

C++ 实现桶排序的示例代码

目录原理实现步骤:模拟生成整数随机数桶排序实现完整版可运行程序时间复杂度计算桶排序:整数 原理原理简述:按照需要排序数组的实际情况,生成一个一定长度的一维数组,用于统计需...

2021-08-09

LeetCode 单调栈内容小结

LeetCode Monotone Stack Summary 单调栈小结所谓的单调栈 Monotone Stack,就是栈内元素都是单调递增或者单调递减的,有时候需要严格的单调递增或递减,根据题目的具体情况来看...

2021-08-09

C++实现LeetCode(768.可排序的最大块数之二)

[LeetCode] 768.Max Chunks To Make Sorted II 可排序的最大块数之二This question is the same as "Max Chunks to Make Sorted" except the integers of the given array...

2021-08-09

C++实现LeetCode(12.整数转化成罗马数字)

[LeetCode] 12. Integer to Roman 整数转化成罗马数字Roman numerals are represented by seven different symbols: I, V, X, L, C, D&#160...

2021-08-09

C++实现LeetCode(16.最近三数之和)

[LeetCode] 16. 3Sum Closest 最近三数之和Given an array nums of n integers and an integer target, find three integers in nums ...

2021-08-09

C++学习进阶之Makefile基础用法详解

目录1. Makefile基本语法与执行
2. Makefile简化过程
3. Makefile生成并使用库
3.1 动态库的建立与使用
3.2 动态加载库的建立与使用总结1. Makefile基本语法与执行
为什么...

2021-08-09

VS2019开发Linux C++程序的实现步骤

一级目录第一步, 先将自己的Linux 系统设为静态IP,具体操作如下:1.修改/etc/network/interfaces 地址配置文件,如下所示:
(注 查看ip命令: ip addr 查看网关命令: ip route sh...

2021-08-09

C++实现LeetCode(83.移除有序链表中的重复项)

[LeetCode] 83. Remove Duplicates from Sorted List 移除有序链表中的重复项Given a sorted linked list, delete all duplicates such that each element appear only&#16...

2021-08-09

C++实现LeetCode(30.串联所有单词的子串)

[LeetCode] 30. Substring with Concatenation of All Words 串联所有单词的子串You are given a string, s, and a list of words, words, that are all of the...

2021-08-09

C++实现LeetCode(42.收集雨水)

[LeetCode] 42. Trapping Rain Water 收集雨水Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how m...

2021-08-09

教你Clion调试ROS包的方法

产品概述
Clion是一款专门开发C以及C++所设计的跨平台的IDE。它是以IntelliJ为基础设计的,包含了许多智能功能来提高开发人员的生产力。这种强大的IDE帮助开发人员在Linux、O...

2021-08-09

C++实现LeetCode(45.跳跃游戏之二)

[LeetCode] 45. Jump Game II 跳跃游戏之二Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in th...

2021-08-09

C++实现LeetCode(13.罗马数字转化成整数)

[LeetCode] 13. Roman to Integer 罗马数字转化成整数Roman numerals are represented by seven different symbols: I, V, X, L, C, D&#160...

2021-08-09

C语言库的封装和使用方法总结

目录前言windows下静态库创建和使用静态库的创建静态库的使用方法一:添加工程中方法二:配置项目属性方法三:使用编译语句静态库优缺点缺点windows下动态库创建和使用静态库中生...

2021-08-09

C++实现LeetCode(88.混合插入有序数组)

[LeetCode] 88. Merge Sorted Array 混合插入有序数组Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as...

2021-08-09

C++实现LeetCode(23.合并k个有序链表)

[LeetCode] 23. Merge k Sorted Lists 合并k个有序链表Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.E...

2021-08-09

C++实现LeetCode(27.移除元素)

[LeetCode] 27. Remove Element 移除元素Given an array nums and a value val, remove all instances of that value in-place and return the n...

2021-08-09

C++实现LeetCode(11.装最多水的容器)

[LeetCode] 11. Container With Most Water 装最多水的容器Given n non-negative integers a1, a2, ..., an , where each represents a poi...

2021-08-09

C++实现LeetCode(17.电话号码的字母组合)

[LeetCode] 17. Letter Combinations of a Phone Number 电话号码的字母组合Given a string containing digits from 2-9inclusive, return all possible letter combi...

2021-08-09

基于MFC实现贪吃蛇小游戏

本文实例为大家分享了MFC实现贪吃蛇小游戏的具体代码,供大家参考,具体内容如下一、功能描述(1)通过“START”、“PAUSE”、“EXIT”三个控件,控制游戏的开始、暂停和终止。(2)通过...

2021-08-09

C++实现LeetCode(56.合并区间)

[LeetCode] 56. Merge Intervals 合并区间Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]
Output: [[...

2021-08-09

C++实现LeetCode(60.序列排序)

[LeetCode] 60. Permutation Sequence 序列排序The set [1,2,3,...,n] contains a total of n! unique permutations.By listing and labeling all of the p...

2021-08-09

C++实现点云添加高斯噪声功能

0 添加高斯噪声后的点云
红色为添加的高斯噪声点,白色为原始点1 什么是高斯噪声
高斯噪声是指它的概率密度函数服从高斯分布(即正态分布)的一类噪声。(百度百科)高斯分布,也称正态...

2021-08-09

C++实现LeetCode(33.在旋转有序数组中搜索)

[LeetCode] 33. Search in Rotated Sorted Array 在旋转有序数组中搜索Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand....

2021-08-09

C++实现LeetCode(51.N皇后问题)

[LeetCode] 51. N-Queens N皇后问题The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens a...

2021-08-09
返回顶部
顶部