C/C++
胡大佬
这个作者很懒,什么都没留下…
展开
-
C++查看运行时间
参考链接:https://www.cnblogs.com/dwdxdy/p/3214905.html#include <iostream>#include <ctime>#include <cstdlib>#include <Windows.h>#include <vector>#include <iostream>...原创 2018-11-12 23:13:32 · 919 阅读 · 0 评论 -
C++ random_shuffle用法
参考 http://www.cplusplus.com/reference/algorithm/random_shuffle//*template <class RandomAccessIterator, class RandomNumberGenerator> void random_shuffle (RandomAccessIterator first, RandomAcc...原创 2018-11-12 23:27:39 · 5739 阅读 · 0 评论 -
C++指针
指针语法详解:https://blog.csdn.net/qq_41035588/article/details/79673674智能指针剖析:http://www.cnblogs.com/lanxuezaipiao/p/4132096.htmlmalloc与new的区别:http://www.cnblogs.com/ywliao/articles/8116622.html...转载 2018-11-18 09:20:17 · 106 阅读 · 0 评论 -
linux C语言获取时间
微秒级: https://blog.csdn.net/zhubaohua_bupt/article/details/52873082#include <stdio.h> // for printf()#include <sys/time.h> // for gettimeofday()#include <unistd.h> ...转载 2018-12-17 13:16:14 · 1164 阅读 · 0 评论 -
C++ list(双向环状链表)的常用操作
C++ STL list操作,list采用link存储,参考资料(侯捷,STL源码剖析)list 使用双向环状链表形式,环状链表只需一个标记,所以可以在链表尾端插入一个空白节点,使之符合STL前闭后开的规范list的主要操作transfer,移动元素的位置,splice基于transfer实现// 将[first, last)内的所有元素移动到position之前, .操作符的优先级 ...原创 2019-02-05 22:30:44 · 1032 阅读 · 0 评论 -
STL deque的实现
参考自 侯捷, STL源码剖析class deque definitiondeque采用一块所谓的map作为主控,这里的map是一块连续空间,其中每个元素都是一个指针,指向一段(较大的)连续线性空间,称为缓冲区,SGI STL允许我们指定缓冲区大小,默认值0表示将使用512bytes缓冲区。template<class T, class Alloc=alloc, size_t Bu...原创 2019-02-05 23:16:47 · 430 阅读 · 0 评论 -
C++ algorithm, the operation of heap
{ // test heap, 底层以vector完成 int ia[9] = { 0,1,2,3,4,8,9,3,5 }; vector<int> ivec(ia, ia + 9); make_heap(ivec.begin(), ivec.end()); for (int i = 0; i < ivec.size(); i++) { cout &...原创 2019-02-18 19:57:09 · 119 阅读 · 0 评论 -
C++ usage of priority queue
#include <queue>#include <algorithm>#include <functional>#include <iostream>using namespace std;struct myps{ int index; int val; myps(int x = 1, int y = 2):in...原创 2019-02-18 20:23:26 · 136 阅读 · 0 评论