C++实现LeetCode( 69.求平方根)

[LeetCode] 69. Sqrt(x) 求平方根Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative...

2021-08-09

C++实现LeetCode(79.词语搜索)

[LeetCode] 79. Word Search 词语搜索Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adj...

2021-08-09

C++实现LeetCode(87.搅乱字符串)

[LeetCode] 87. Scramble String 搅乱字符串Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively...

2021-08-09

C++ 递归遍历文件并计算MD5的实例代码

递归遍历文件夹,对比文件md5首先,需要引用 md5 的相关代码,参考这篇文章,防止链接内容被删除,这里再记录一次:
md5.h #ifndef MD5_H #define MD5_H #include <string> #...

2021-08-09

C++实现LeetCode(137.单独的数字之二)

[LeetCode] 137. Single Number II 单独的数字之二Given a&#160;non-empty&#160;array of integers, every element appears&#160;three&#160;times except for one, which...

2021-08-09

C++实现LeetCode(96.独一无二的二叉搜索树)

[LeetCode] 96. Unique Binary Search Trees 独一无二的二叉搜索树Given&#160;n, how many structurally unique&#160;BST's&#160;(binary search trees) that store values...

2021-08-09

C++实现LeetCode(74.搜索一个二维矩阵)

[LeetCode] 74. Search a 2D Matrix 搜索一个二维矩阵Write an efficient algorithm that searches for a value in an&#160;m x n&#160;matrix. This matrix has the follo...

2021-08-09

C++实现LeetCode(141.单链表中的环)

[LeetCode] 141. Linked List Cycle 单链表中的环Given a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an in...

2021-08-09

Opencv开发实现拼图游戏

本文实例为大家分享了Opencv开发实现拼图游戏的具体代码,供大家参考,具体内容如下一、代码#include<opencv2/opencv.hpp>#include<iostream>#include<stdlib.h>#include<time....

2021-08-09

C++实现骑士走棋盘算法

本文实例为大家分享了C++实现骑士走棋盘算法的具体代码,供大家参考,具体内容如下1.问题描述骑士旅游Knight tour在十八世纪初倍受数学家与拼图迷的注意,它什么时候被提出已不可...

2021-08-09

C语言模拟实现动态通讯录

目录1.模拟实现通讯录总体架构一览图2.文件执行任务3.分模块实现 测试模块 test.c头文件 功能函数声明 contact.h功能函数逐一实现1.模拟实现通讯录总体架构一览图2.文件执...

2021-08-09

C++实现LeetCode(106.由中序和后序遍历建立二叉树)

[LeetCode] 106. Construct Binary Tree from Inorder and Postorder Traversal 由中序和后序遍历建立二叉树Given inorder and postorder traversal of a tree, construct...

2021-08-09

C/C++中指针的深入理解

目录计算机的内存模型
指针与指针常量
指针变量和指针常量
指针变量和数组
函数指针
C++中的引用
传值还是传引用
C++中的new关键词
总结计算机的内存模型
CPU是计算机的核...

2021-08-09

老生常谈c++中的静态成员

引言有时候需要类的一些成员与类本身相关联,而不是与类的每个对象相关联。比如类的所有对象都要共享的变量,这个时候我们就要用到类的静态成员。声明类的静态成员声明静态成员...

2021-08-09

C++实现LeetCode(101.判断对称树)

[LeetCode] 101.Symmetric Tree 判断对称树Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary t...

2021-08-09

C++实现LeetCode(104.二叉树的最大深度)

[LeetCode] 104. Maximum Depth of Binary Tree 二叉树的最大深度Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the long...

2021-08-09

C语言转义字符详解

####1.认识转义字符所有的ASCII码都可以用“\”加数字(一般是8进制数字)来表示。而C中定义了一些字母前加""来表示常见的那些不能显示的ASCII字符,如\0,\t,\n等,就称为转义字符,...

2021-08-09

C++实现LeetCode(889.由先序和后序遍历建立二叉树)

[LeetCode] 889. Construct Binary Tree from Preorder and Postorder Traversal 由先序和后序遍历建立二叉树Return any binary tree that matches the given preorder and...

2021-08-09

C++实现LeetCode(143.链表重排序)

[LeetCode] 143.Reorder List 链表重排序Given a singly linked list&#160;L:&#160;L0→L1→…→Ln-1→Ln,
reorder it to:&#160;L0→Ln→L1→Ln-1→L2→Ln-2→…You may&#1...

2021-08-09

C语言版三子棋小游戏

本文实例为大家分享了C语言版三子棋小游戏的具体代码,供大家参考,具体内容如下①游戏效果 有一个3*3的棋盘 每次下棋后(电脑和玩家),棋盘会更新数据 会有菜单提示相...

2021-08-09

C++实现批量图片拼接

本文实例为大家分享了C++实现批量图片拼接的具体代码,供大家参考,具体内容如下/**函数功能:不同图片拼接 * 参数: * vector<string> pic_list : 图片名称列表...

2021-08-09

OpenCV实现拼图算法

本文实例为大家分享了OpenCV实现拼图算法的具体代码,供大家参考,具体内容如下编程环境:VS2012+OpenCV2.4.6功能:第一种是将指定三幅图的指定位置的像素直接搬移到新的图像上第二...

2021-08-09

关于C语言和命令行之间的交互问题

在Windows操作系统中,后缀为.exe的文件都是可执行文件。.exe是英文单词executable的缩写,意思是可执行的。凡是可执行的文件都是二进制的文件,计算机也只能识别二进制的文件。...

2021-08-09

C++实现LeetCode(145.二叉树的后序遍历)

[LeetCode] 145. Binary Tree Postorder Traversal 二叉树的后序遍历Given a binary tree, return the postorder traversal of its nodes' values.For example:
Given bina...

2021-08-09

C++实现LeetCode(102.二叉树层序遍历)

[LeetCode] 102. Binary Tree Level Order Traversal 二叉树层序遍历Given a binary tree, return the&#160;level order&#160;traversal of its nodes' values. (ie, from...

2021-08-09

C++实现LeetCode(103.二叉树的之字形层序遍历)

[LeetCode] 103. Binary Tree Zigzag Level Order Traversal 二叉树的之字形层序遍历Given a binary tree, return the&#160;zigzag level order&#160;traversal of its nod...

2021-08-09

C语言之函数返回值与参数传递案例教程

C语言函数返回值与参数传递一:参数传递C语言的函数中必不可少的就是参数传递,可以采用传值和传指针两种方式。
1.传值的形式:只是将参数值的拷贝传给函数,并非参数本体如:int tes...

2021-08-09

C语言中操作sqlserver数据库案例教程

本文使用c语言来对sql server数据库进行操作,实现通过程序来对数据库进行增删改查操作。操作系统:windows 10 &#160; &#160; &#160; &#160; 实验平台:vs2012&#160; +&#160; sql...

2021-08-09

C++实现LeetCode(105.由先序和中序遍历建立二叉树)

[LeetCode] 105. Construct Binary Tree from Preorder and Inorder Traversal 由先序和中序遍历建立二叉树Given preorder and inorder traversal of a tree, construct th...

2021-08-09

C++实现LeetCode(109.将有序链表转为二叉搜索树)

[LeetCode] 109.Convert Sorted List to Binary Search Tree 将有序链表转为二叉搜索树Given a singly linked list where elements are sorted in ascending order, conver...

2021-08-09

C++实现LeetCode(142.单链表中的环之二)

[LeetCode] 142. Linked List Cycle II 单链表中的环之二Given a linked list, return the node where the cycle begins. If there is no cycle, return&#160;null.To repr...

2021-08-09

c++中的基本IO类型详解

引言c++不直接处理输入和输出,而是通过标准库中的类型处理IO。IO的设备可以是文件、控制台、string。c++主要定义了三种IO类型,分别被包含在iostream、fstream、sstream头文...

2021-08-09

TypeScript的函数定义与使用案例教程

TypeScript中函数的定义和使用1. 声明一个函数约束其传参类型,以及返回值类型 传入两个参数,没有返回值const fun1 = (key: string, value: number): void => { console.log(k...

2021-08-09

C++实现LeetCode(111.二叉树的最小深度)

[LeetCode] 111. Minimum Depth of Binary Tree 二叉树的最小深度Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shor...

2021-08-09

C++之Qt5双缓冲机制案例教程

1. 双缓冲机制所谓双缓冲机制,是指在绘制控件时,首先将要绘制的内容绘制在一个图片中,再将图片一次性地绘制到控件上。在早期的Qt版本中,若直接在控件上进行绘制工作,则在控件重...

2021-08-09

C++实现LeetCode(107.二叉树层序遍历之二)

[LeetCode] 107. Binary Tree Level Order Traversal II 二叉树层序遍历之二Given the&#160;root&#160;of a binary tree, return&#160;the bottom-up level order traversa...

2021-08-09

C++实现LeetCode(108.将有序数组转为二叉搜索树)

[LeetCode] 108.Convert Sorted Array to Binary Search Tree 将有序数组转为二叉搜索树Given an array where elements are sorted in ascending order, convert it to a h...

2021-08-09

C语言之system函数案例详解

来看看在windows操作系统下system () 函数详解(主要是在C语言中的应用)
注意:在windows下的system函数中命令可以不区别大小写!
函数名: system
功 能: 发出一个DOS命令
用 法...

2021-08-09

C语言多种获取字符串长度的方法

在C语言中,想要获取字符串长度可以有很多方法,下面分别介绍一、使用sizeof()运算符在C语言中,sizeof() 是长度的运算符,括号中可以放入数据类型或者表达式,一般我们用来计算字符...

2021-08-09

C语言版猜数字小游戏

本文实例为大家分享了C语言版猜数字小游戏的具体代码,供大家参考,具体内容如下清楚实现目标做任何一个小项目之前,我们首先都需要明确自己想要实现的目标.所以猜数字游戏的实...

2021-08-09

C++基于EasyX库实现拼图小游戏

用C++的EasyX库做的拼图小游戏,供大家参考,具体内容如下&#8195;&#8195;记录一下自己做的第一个项目,还有一些改进空间QWQ,可以支持难度升级,但是通关判断似乎有点小问题肯定不是...

2021-08-09

C语言strtod()函数案例详解

前言网上有很多关于strtod()函数的文章,不过大部分都是用strtod()函数转换一个字符char *str = "111.11";char *target;double ret;ret = strtod(str, &target);很少有转换字...

2021-08-09

C++实现LeetCode(110.平衡二叉树)

[LeetCode] 110.Balanced Binary Tree 平衡二叉树Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined...

2021-08-09

C++实现LeetCode(100.判断相同树)

[LeetCode] 100. Same Tree 判断相同树Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if th...

2021-08-09

C语言实现控制台五子棋小游戏

这是一个用C语言实现的控制台小游戏—-五子棋,棋盘大小和获胜棋子数目是用宏定义的,可以自定义,所以可以轻松改为三子棋、六子棋等等。此游戏设定为人机对战(PVE),电脑走棋是随机...

2021-08-09

C++实现LeetCode(130.包围区域)

[LeetCode] 130. Surrounded Regions 包围区域Given a 2D board containing&#160;'X'&#160;and&#160;'O'(the letter O), capture all regions surrounded by&#160;'X'.A re...

2021-08-09

C++实现LeetCode(120.三角形)

[LeetCode] 120.Triangle 三角形Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For ex...

2021-08-09

C++实现LeetCode(122.买股票的最佳时间之二)

[LeetCode] 122.Best Time to Buy and Sell Stock II 买股票的最佳时间之二Say you have an array for which the&#160;ith&#160;element is the price of a given stock on...

2021-08-09

用C语言实现五子棋小游戏

简介本次五子棋使用的是光标控制移动,通过按空格键(键值32)来落子,实现游戏的。
我们额外用到的头文件有:#include<getch.h>
&#8195;&#8195;通过调用getch()函数来识别 上下左右...

2021-08-09

C++ vector如何动态申请内存的元素

vector是一种动态数组,在内存中具有连续的存储空间,支持快速随机访问。由于具有连续的存储空间,所以在插入和删除操作方面,效率比较慢。vector有多个构造函数,默认的构造函数是构...

2021-08-09
返回顶部
顶部