算法初探
雨季不再来打码
我们抱以高歌,奔赴下场花海
展开
-
用一个算法小芝士怎样判断输入回文内容
用一个算法小芝士怎样判断输入回文内容什么是回文?在小学就学过,这个就是例如蜜蜂采蜂蜜,奶牛喝牛奶,跑步是我们大家喊的121这样样式的就是回文,所以这样运用算法的判断这个输入的内容是回文呢?让我们来实现它:#include "stdio.h"#include "stdlib.h"#include "malloc.h"#include "string"#define NULL 0#define OK 1#define ERROR 0#define false 0#define ture原创 2021-10-11 21:52:20 · 128 阅读 · 0 评论 -
算法上对二叉树进行(前序,中序,后序)遍历,对树高,叶子个数,节点个数挑战大礼包!!!
#include "stdio.h"#include "malloc.h"typedef int TelernType;typedef struct BTreeNode{ TelernType data; //树的数据域为字符型 struct BTreeNode* LChild; //*左孩子指针 struct BTreeNode* RChild; //*右孩子指针 int height;}BTree;BTree* CreatBTree()原创 2021-10-08 16:54:31 · 122 阅读 · 0 评论 -
算法队列实验设计操作看这篇就够了
加油吧!!!#include "stdio.h"#include "malloc.h"#define ERROR 0#define OK 1typedef int datatype;#define MAXSIZE 50 //队列的最大容量//定义队列的结构体typedef struct{ datatype data[MAXSIZE]; int front, rear;}SeQueue;//置空队SeQueue* InitSqQueue(){ SeQueue*原创 2021-10-08 16:41:56 · 110 阅读 · 0 评论 -
算法中运用栈操作对数据进行显示,入栈,出栈,进制转换一体设计
有了基础的框架,就要有实践的真知,所以我不断完善自己,遇到更好的代码,实现更加功能完美的代码。#include "stdio.h"#include "stdlib.h"#include "malloc.h"#include "string"#define NULL 0#define OK 1#define ERROR 0typedef int datatype;typedef struct node //定义链式栈结构{ datatype data; struct node*原创 2021-10-08 11:35:54 · 157 阅读 · 0 评论 -
算法上对顺序存储(顺序表)和链式存储(链表)上增,删,查,显的一体设计
一.顺序表#include <stdio.h>#define maxsize 100#include <stdlib.h>#define error 0#define ok 1typedef int elemtype; elemtype elem[maxsize]; int length;}sqlist;typedef struct {sqlist* creatlist() //初始化{ sqlist* L; L = (sqlist*)mallo原创 2021-10-08 11:31:46 · 193 阅读 · 0 评论