声明成员变量 class CMyCtrl/CMyView : public CListCtrl/CListView { ... public: CMyCtrl/CMyView(); // 构造函数 protected: const int m_nMinWidth = 80; // 最小列宽(如果不需 ...
分类:
编程语言 时间:
2020-08-20 18:56:44
阅读次数:
64
2020.08.05 1、多线程 2、IPC、共享内存 3、bind 4、合并n个有序链表 (力扣原题 使用最小堆会快一些) #include <queue> using namespace std; struct ListNode { int val; ListNode* next; ListNo ...
分类:
其他好文 时间:
2020-08-20 18:20:10
阅读次数:
118
约瑟夫问题: #include <stdio.h> #include <stdlib.h> typedef struct node{ int data; struct node * next; }node; //创建一个有n个结点的循环链表 node * initLink(int n){ node ...
分类:
其他好文 时间:
2020-08-20 18:19:30
阅读次数:
49
自己之前纠正过这个问题,但还是忘了。今天再拿出来。 今天主要总结关于使用 c++ 标准中的 new 关键字。 【结论】 A、处理new可能抛出的异常 B、针对new使用std::nothrow不抛出异常 1、错误示范 下面一段代码,使用new向堆申请空间,再释放的过程 1 char *pbuf = ...
分类:
编程语言 时间:
2020-08-20 18:16:43
阅读次数:
76
int height(struct TreeNode* root) { if (root == NULL) { return 0; } else { return fmax(height(root->left), height(root->right)) + 1; } } bool isBalanc ...
分类:
其他好文 时间:
2020-08-19 19:58:57
阅读次数:
65
struct关键字是用来定义一个新的类型,这个新类型里面可以包含各种其他类型,称为结构体。 #include <stdio.h> typedef struct { int a; int b; }Stu; Stu getStu(int x, int y) { Stu result; result.a ...
分类:
编程语言 时间:
2020-08-19 19:42:50
阅读次数:
65
1.嵌套循环:将一个循环结构嵌套在另一个循环结构中。例如A在B中循环 2.外层循环:B 内层循环: A 3.假设外层循环了M次,内层循环了N次,一共循环了M*N次 4.外层控制行数,内层控制个数 package struct; public class demo21 { public static ...
分类:
其他好文 时间:
2020-08-19 19:09:10
阅读次数:
62
数据库简介 按照数据结构,来组织、存储管理数据的仓库。 mysql 关系型的数据库 sql (struct query language) 甲骨文 oracle(甲骨文数据库) sql server(windows专有数据) access (windows) pgsql(postgre sql) s ...
分类:
数据库 时间:
2020-08-17 16:59:43
阅读次数:
72
题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 输入:1->2->4, 1->3->4 输出:1->1->2->3->4->4 分析与题解 在忽略空链表的情况下,利用递归的思想依次对两个链表的元素进行比较和合并,大致思路如下: $$\l ...
分类:
编程语言 时间:
2020-08-15 22:32:54
阅读次数:
63
题目地址:https://leetcode-cn.com/problems/merge-k-sorted-lists/ 解题思路:简单的分治算法 /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis ...
分类:
编程语言 时间:
2020-08-15 22:27:55
阅读次数:
64