自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 数据结构之链表的使用

数据结构中的链表这一结构的基本操作#include #include typedef struct Node{ int data; struct Node *next;}Node, *LinkedList;LinkedList insert(LinkedList head, Node *node, int index) { if (head

2017-09-14 20:30:31 188

原创 数据结构之顺序表的使用

#include #include #define ERROR 0#define OK 1typedef struct Vector { int size,length; int* data;} Vector;void init(Vector *vector, int size) { vector->size=size;

2017-09-14 20:23:27 205

原创 数据结构之栈的应用(3)逆波兰式

Lintcode和计蒜客上的一道难题。直接上代码。难点在于式子的转换。转化成逆波兰式之后,计算的算法写起来很方便。#include #include #include #include #define ERROR 0#define OK 1typedef struct Stack { int *elements; int max_size,

2017-09-10 14:31:19 363

原创 数据结构之栈的应用(2)回文序列

典型的用栈来解决问题 话不多说 直接上代码勉强说容易遗忘的点就是如何以特殊字符结束字符串,算是很基本的东西,但是容易忘。这里利用了栈结构先进后出的性质,直接反转字符串,再利用strcmp函数对比输入串和输出串即可。#include#include#include#define ERROR 0;#define OK 1;typedef struct Stack

2017-09-10 11:34:19 464

原创 数据结构之栈的应用(1) 用栈模拟Hanoi塔

在Lintcode算是简单题了 九章算法给的C++版本的 这里提供C语言版的供参考#include#include#define ERROR 0;#define OK 1;typedef struct Stack{ int *elements; int max_size,top_index;}Stack;void init(Stack *

2017-09-10 11:25:37 286

原创 数据结构之栈的使用

话不多说 直接看代码包含栈的初始化函数,添加元素,移除元素,检测是否为空栈以及输出栈顶元素。#include#include#define ERROR 0;#define OK 1;typedef struct Stack{ int *elements; int max_size,top_index;}Stack;void init(

2017-09-10 11:20:38 150

空空如也

空空如也

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

TA关注的人

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