
数据结构
PeasantCoding
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C语言实现二叉树的遍历等操作
#include <stdio.h> #include <stdlib.h> #define MAX_TREE_SIZE 100 typedef char DataType ; typedef struct BiTNode{ DataType data; struct BiTNode *lchild,*rchild; }BiTNode,*BiTree; //定义树遍历函数的指针 typedef void(*TREEORDER_FUN)(BiTree &BT); .原创 2020-11-25 12:37:06 · 519 阅读 · 0 评论 -
C语言纯指针实现回文判断
#include<stdio.h> #include<string.h> void ishuiwen(char *str) { char *p = str; char *q = str; while(*q!='\0'){q++;} q--;//指针指向'\0'自减从而指向最后一个字符 int i; int flag = 1; for(i=0;i...原创 2018-04-12 15:22:50 · 6567 阅读 · 0 评论 -
C语言解决约瑟夫环问题
#include <stdio.h> #include <stdlib.h> typedef struct Node{ int data; struct Node *next; }LNode,*LinkList; //创建无头结点的循环链表 void create_L(LinkList &L,int n) { LinkList r = L; for(int i = 1;i<=n;i++) { LinkList ...原创 2020-11-25 12:07:17 · 725 阅读 · 0 评论 -
C语言实现非循环单链表基本操作
#include<stdio.h> #include<malloc.h> typedef struct Node{ int date;//节点数据 struct Node * pNext;//指向下一个节点的指针 }*PNODE,NODE; PNODE creat_list()//创建链表 { int len,val,i; PNODE p...原创 2018-01-02 16:54:06 · 486 阅读 · 0 评论 -
C,C++实现Java中ArrayLsit
C语言版 ArrayList.h #ifndef ARRAYLIST_H #define ARRAYLIST_H #include"ArrayList.h" struct Arr { int *pBase;//数组首元素地址 int len;//数组最大长度 int cnt;//数组有效个数 }; void init_arr(struct Arr *pArr,in...原创 2017-12-29 12:38:21 · 416 阅读 · 0 评论 -
如何用C++实现一个动态栈的基本操作
#include <iostream> using namespace std; class Node { int date;//节点数据 Node *pNext;//指向下一个节点的指针 friend class Stack;//友元类 }; class Stack { public: Stack()//构造器 { pTop...原创 2018-01-04 19:11:56 · 683 阅读 · 0 评论 -
C语言实现动态栈基本操作
#include <stdio.h> #include<malloc.h> #include<stdlib.h> typedef struct Node { int date; struct Node *pNext; }NODE,*PNODE; typedef struct Stack { PNODE Top; PNODE ...原创 2018-01-04 19:13:27 · 591 阅读 · 0 评论