06 2022 档案

摘要:strlen_test.cpp #include<iostream>#include<cstring>#include<time.h> using namespace std; /自定义strlen int my_strlen(char * str){ char* start = str; whil 阅读全文
posted @ 2022-06-16 02:02 danieldai 阅读(129) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; template<typename T> struct comp_function{ bool operator()(const T &lhs,const T &rhs){ return lhs<rhs; }}; //比 阅读全文
posted @ 2022-06-15 00:21 danieldai 阅读(31) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; //调整堆void adjust_heap(int *arr,int size,int pos){ int left = pos*2 +1; int right = pos*2 + 2; //左右两边先选取最小的,如果大 阅读全文
posted @ 2022-06-12 22:36 danieldai 阅读(23) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<stack>using namespace std; template<typename T>struct queue{ stack<T> s1; stack<T> s2; void push_queue(const T& val); void 阅读全文
posted @ 2022-06-11 15:43 danieldai 阅读(13) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<stack>using namespace std; struct queue{ stack<int> s1; stack<int> s2; void push_queue(int val);void pop_queue(); bool empt 阅读全文
posted @ 2022-06-11 14:26 danieldai 阅读(23) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<queue> using namespace std; struct stack{ queue<int> que1; queue<int> que2; static int STACK_EMPTY; void push_stack(int val 阅读全文
posted @ 2022-06-06 13:51 danieldai 阅读(43) 评论(0) 推荐(0) 编辑