上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 19 下一页
摘要: 性质 二叉堆是一颗完全二叉树,而完全二叉树是把元素排列成树的形状。 堆中某个节点的值总不大于其父节点的值最大堆(相应的可以定于最小堆) // 返回完全二叉树的数组表示中,一个索引所表示的元素的父亲节点的索引 constexpr int parent(const int index) const { 阅读全文
posted @ 2021-07-11 19:06 放飞梦想C 阅读(1004) 评论(0) 推荐(0)
摘要: 双向循环链表 关于双向循环链表可以先阅读这篇文章这里就不再赘述:双向链表(DoubleLinkList) Node template<typename T> class Node { public: T e; Node *prev; Node *next; Node() : e(0), prev(n 阅读全文
posted @ 2021-07-06 16:48 放飞梦想C 阅读(237) 评论(0) 推荐(0)
摘要: 双向链表 有关链表的知识可以点击我上篇文章这里就不再赘述LinkedList 双向链表也叫双链表,是链表的一种,它的每个数据结点中都有两个指针,分别指向直接后继和直接前驱。所以,从双向链表中的任意一个结点开始,都可以很方便地访问它的前驱结点和后继结点。一般我们都构造双向循环链表。 双向循环链表的可以 阅读全文
posted @ 2021-07-06 16:21 放飞梦想C 阅读(391) 评论(0) 推荐(0)
摘要: 源文件 #include<stdio.h> int main() { printf("hello world!"); return 0; } 预处理 使用以下命令把.c文件进行宏展开生成.i文件 gcc -E main.c -o main.i 编译器对各种预处理命令进行处理,包括头文件包含、宏定义的 阅读全文
posted @ 2021-06-29 15:25 放飞梦想C 阅读(142) 评论(0) 推荐(0)
摘要: 引入的头文件io_utils/time_utils 文件字符个数 #include<stdio.h> #include<locale.h> #include<wchar.h> #include"../include/io_utils.h" #define ERROR_ILLEGAL_FILENAME 阅读全文
posted @ 2021-06-28 20:25 放飞梦想C 阅读(83) 评论(0) 推荐(0)
摘要: 头文件 #pragma once #if defined(_WIN32) #include<sys/timeb.h> #if defined(__UNIX__)||defined(__APPLE__) #include<time.h> #endif typedef long long long_ti 阅读全文
posted @ 2021-06-28 20:23 放飞梦想C 阅读(224) 评论(0) 推荐(0)
摘要: 线程安全问题 #include <stdio.h> #include <tinycthread.h> #include <io_utils.h> int count = 0; int Counter(void*arg) { for(int i = 0;i<100000;i++) { count++; 阅读全文
posted @ 2021-06-28 20:03 放飞梦想C 阅读(480) 评论(0) 推荐(0)
摘要: Σ(っ °Д °;)っ #include<iostream> struct Entity { int x, y; int* GetPtr() { return &x; } /*Entity* GetPtr() { return this; }*/ }; int main() { Entity e = 阅读全文
posted @ 2021-06-17 15:54 放飞梦想C 阅读(106) 评论(0) 推荐(0)
摘要: #include<iostream> #include<chrono> struct Timer { std::chrono::time_point<std::chrono::steady_clock>start, end; std::chrono::duration<float>duration; 阅读全文
posted @ 2021-06-17 15:07 放飞梦想C 阅读(49) 评论(0) 推荐(0)
摘要: #include<iostream> #include<chrono> struct Timer { std::chrono::time_point<std::chrono::steady_clock>start, end; std::chrono::duration<float>duration; 阅读全文
posted @ 2021-06-16 20:26 放飞梦想C 阅读(87) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 19 下一页