自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 HDU-5976

HDU-5976 首先要想到贪心策略,下面是我想到贪心策略后没有优化的傻逼写法,直接T掉了 #include<set> #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<string> #include<c...

2019-11-08 20:12:12 307

原创 Morris遍历二叉树

Morris遍历二叉树 Morris遍历可以做到额外空间复杂度O(1),时间复杂度O(n)。 需要两个指针cur和mostringt cur为当前节点 1.若cur没有左孩子 cur=cur->right 2.若cur有左孩子,找到左孩子的最右节点记为mostringt 若mostringt->right= =NULL,mostringt->right=cur , cur=cur...

2019-08-09 15:40:16 178

原创 KMP模板

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<climits> using namespace std; const int Max=100005; int next[Max]; void GetNext(string p) {...

2019-08-02 18:54:28 136

原创 双向链表的逆置

//结构体形式如下 typedef struct node { int data; node* next; node* prior; } Node,*List; node* reverselist(node *head)//这里头节点的next指针指向第一个节点 { if(NULL==head||NULL==head->next) { ...

2019-07-29 18:31:21 1142

原创 单向链表相交问题

#include <iostream> #include<cstdlib> using namespace std; //判断单链表是否有环 Node* getLoopNode(Node *head) { if(NULL == head || NULL == head->next || NULL == head->next->next) ...

2019-07-29 17:48:57 177

原创 链表实现荷兰国旗

#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<string> #include<algorithm> #include<queue> #include<map> #include<s...

2019-07-29 17:06:03 345

原创 链表逆置 m-n

链表逆置 m-n #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<string> #include<algorithm> #include<queue> #include<map> #inc...

2019-07-29 15:23:27 171

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除