- 博客(19)
- 收藏
- 关注
原创 (借助栈)二叉树中序非递归遍历
#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>typedef struct treeNode{ int data; struct treeNode* rChild; struct treeNode* lChild;}tree, *BinTree;typedef stru...
2020-04-30 21:22:57 277
原创 (顺序存储)串的基本操作(包含BP,KMP)
#define _CRT_SEURE_NO_WARNINGS#include<iostream>#include<stdio.h>#include<stdlib.h>#define MAXSIZE 100using namespace std;typedef struct st{ char* ch; int length; int strS...
2020-04-30 21:20:59 274
原创 (链表存储)出栈入栈操作
#include<stdio.h>#include<stdlib.h>#define OK 1;#define ERROR 0;typedef struct StackNode{ int data; struct StackNode* pNext;}stackNode,*pStackNode;int init(pStackNode& pHe...
2020-04-30 21:13:14 282
原创 文件
1.File类import java.io.File;public class Main{ public static void main(String[] args)throws Exception { File file=new File("F:"+File.separator+"JavaSE"+File.separator+"JaveEdu"+File.separator+"...
2020-04-30 21:06:33 123
原创 异常
import java.io.IOException;class myMath{ public static int div(int x,int y) throws ArithmeticException,NullPointerException//声明可能抛出的异常,该方法的调用者要处理这些异常 { String s=null; System.out.println(s.equ...
2020-04-30 14:46:27 111
原创 线程类
class MyThread extends Thread//定义线程类{ private String name; public MyThread(String name) { this.name=name; } public void run()//覆写run方法 { for(int i=0;i<10;i++) { System.out.prin...
2020-04-30 14:41:33 107
原创 泛型类和泛型接口
class Message<T extends Number>{ public T info; public T getInfo() { return this.info; } public void setInfo(T info) { this.info=info; }}public class TestDemo{ public static ...
2020-04-30 14:22:08 112
原创 中序线索二叉树
#include<stdio.h>#include<stdlib.h>typedef enum PointerTag{ Thread, Point};typedef struct node{ char data; PointerTag lTag,rTag; struct node* lChild; struct node* rChild;}Tre...
2020-04-28 13:19:16 439
原创 (顺序存储)队列的基本操作
#include<stdio.h>#include<stdlib.h>#define MAX_LENGTH 6#define OK 1#define ERROR 0/*q.head==q.tail是空队列条件 (q.tail+1)%MAX_LENGTH==0是满队列条件 */typedef struct Queue{ int head,tail; i...
2020-04-28 13:06:28 186
原创 二叉树同构
#include<stdio.h>#include<stdlib.h>#define MAX_SIZE 20#define YES 1#define NO 0struct TreeNode{ char data; int leftSon,rightSon;}Tree1[MAX_SIZE],Tree2[MAX_SIZE];int buildTree(...
2020-04-28 13:02:30 141
原创 稀疏矩阵基本操作
转置是对的,加法乘法没测试过。#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>#define MAX_SIZE 1000#define ERROR -1;#define OK 0typedef struct{ int i, j;//数据的行列值 int value;...
2020-04-28 12:59:47 261
原创 二叉树遍历算法的应用
#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>#include<iostream>#include<string>#include<stack>using namespace std;typedef struct treeNode{...
2020-04-28 12:51:06 205
原创 数据结构第四章基本作业
#define _CRT_SEURE_NO_WARNINGS#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>using namespace std;typedef struct st{ char* ch; int length;//串的当...
2020-04-28 12:46:03 196
原创 数据结构第三章设计作业(栈实现迷宫求解)
#define _CRT_SECURE_NO_WARINGS#include<stdio.h>#include<stdlib.h>#include<iostream>#include<iomanip>#define STACK_INIT_SIZE 1000using namespace std;int mazeMap[10][10] ...
2020-04-28 12:44:49 181
原创 数据结构第三章基本作业(表达式匹配)
#include<stdio.h>#include<stdlib.h>#include<string>#define OK 1;#define ERROR 0;using namespace std;typedef struct StackNode{ char data; struct StackNode* pNext;}stackNode,...
2020-04-28 12:43:15 155
原创 数据结构第二章设计作业:员工名单(链式存储)
list.h:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>using namespace std;struct worker{ char name[25]; int Num; char position[20];};struct node{ struct wo...
2020-04-28 12:41:53 221
原创 数据结构第二章设计作业:员工名单(顺序存储)
list.h:#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string>#include<fstream>#define MAX_SIZE 100using namespace st...
2020-04-28 12:39:33 217
原创 数据结构第二章基本作业
第二章基本作业包含四个问题。question1.h:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>typedef struct node{ int data; //节点数量 struct node* pNext;}*pNode;struct node* tailC...
2020-04-28 12:35:01 150
原创 数据结构第一章设计作业
将数据写入Excel表格中,生成Excel文件。#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>#include<math.h>void writeFile(double temp[], int n)//Excel文件写入操作{ int i = 0; FILE*...
2020-04-28 12:27:36 167
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人