上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 36 下一页
摘要: 先知道原理,代码会在后面补充(其实是我还没看懂代码。。。) 二叉树的遍历主要有三种: (1)先(根)序遍历(根左右) (2)中(根)序遍历(左根右) (3)后(根)序遍历(左右根) 相关例子:二叉树的先序、中序、后序遍历序列 题目: 先序 A B D E H I C F K G 中序 D B H E 阅读全文
posted @ 2021-03-04 23:03 strive-sun 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 什么是析构函数? 析构函数是一个破坏或删除对象的成员函数。 ~constructor-name(); 析构函数的属性: 销毁对象时,将自动调用析构函数。 不能将其声明为static或const。 析构函数没有参数。 它没有返回类型,甚至没有空。 具有析构函数的类的对象不能成为联合的成员。 析构函数应 阅读全文
posted @ 2021-03-02 10:51 strive-sun 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 什么是构造函数? 构造函数是类的成员函数,用于初始化类的对象。在C ++中,创建对象(类的实例)时会自动调用Constructor。它是该类的特殊成员函数。 构造函数与普通成员函数有何不同? 构造函数与普通函数在以下方面有所不同: 构造函数与类本身具有相同的名称 构造函数没有返回类型 创建对象时会自 阅读全文
posted @ 2021-03-02 10:46 strive-sun 阅读(891) 评论(0) 推荐(0) 编辑
摘要: 不能因为每次做一道算法题就开个随笔,故开个记录贴。坚持就是胜利! IT:https://blog.csdn.net/hackbuteer1/category_9261019.html 初期我不知道该怎么讲解,所以先以代码显示为主。。。。 题库: 每日一题 2021/2/28 单调数列:如果数组是单调 阅读全文
posted @ 2021-02-28 21:46 strive-sun 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 1. char i = 1; printf("%d",i); // char字节用printf以整数型打印出来 2. int (*a[10])int a[10]是函数指针数组 #include <stdio.h> #include <Windows.h> int func1(int n) { pri 阅读全文
posted @ 2021-02-27 19:23 strive-sun 阅读(727) 评论(0) 推荐(1) 编辑
摘要: 回文:正过来和反过来的顺序是相同的就是回文。 比如:122221 #include <iostream> class Solution{ public: bool ishuiwen(int val) { if(val<0 || (val != 0) && (val %10 == 0)) { retu 阅读全文
posted @ 2021-02-26 20:45 strive-sun 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 今天做case的时候遇到一个这样的问题,故记录下来。 Codeproject有类似的案例,不过是使用的MFC模板编译的。 因为我们只需要win32程序,所以就....代码如下: CodeProject: Play GIF using GDI+ 另一个是使用双缓冲实现的,我没尝试:win32双缓冲实现 阅读全文
posted @ 2021-02-26 15:17 strive-sun 阅读(727) 评论(0) 推荐(0) 编辑
摘要: #include <Windows.h> #include <stdio.h> #include <io.h> #include <fcntl.h> #pragma warning(disable:4996) bool ConvertToWideFromUTF8orACP(char* strData 阅读全文
posted @ 2021-02-26 10:47 strive-sun 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 顾名思义, 就是将链表的所有结点反转。 解释见:【剑指offer】反转链表,C++实现(链表) 代码: #include <iostream> struct NodeList { int data; struct NodeList* next; NodeList() :data(0), next(N 阅读全文
posted @ 2021-02-24 10:35 strive-sun 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 效率高于冒泡排序和选择排序。 初始数组:{ 27,1,11,200,31,4,58,78,23,47,9,10000}; 第一轮QuickSort的排序见, 27,1,11,200,31,4,58,78,23,47,9,10000 9,1,11,200,31,4,58,78,23,47,27,100 阅读全文
posted @ 2021-02-23 14:16 strive-sun 阅读(56) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 36 下一页