2022年11月15日
摘要: 本题要求实现二分查找算法。 函数接口定义: Position BinarySearch( List L, ElementType X ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List; struct LNode { E 阅读全文
posted @ 2022-11-15 00:03 Rabbit_XIN 阅读(141) 评论(0) 推荐(0)
  2022年11月13日
摘要: 队列没有元素是 Front Rear指向NULL 只有一个元素时 都指向那一个元素 因为既是第一个元素也是最后一个元素 即队头队尾 Front指向第一个元素 Rear指向最后一个元素 #include <stdlib.h> #include <stdio.h> #include <stdbool.h 阅读全文
posted @ 2022-11-13 21:54 Rabbit_XIN 阅读(25) 评论(0) 推荐(0)
摘要: #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <math.h> /** 循环队列的顺序存储实现 队列头在队列第一个元素前 不指向元素 队列尾是指向队列最后一个元素 */ #define ERROR -1 #d 阅读全文
posted @ 2022-11-13 20:01 Rabbit_XIN 阅读(68) 评论(0) 推荐(0)
  2022年11月12日
摘要: 思路 将中缀表达式转化为后缀表达式处理 数据结构 栈 注 目前只适用 10以内的带括号的 +-*/^ 运算 #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <math.h> #define ElementTyp 阅读全文
posted @ 2022-11-12 21:51 Rabbit_XIN 阅读(70) 评论(0) 推荐(0)
  2022年11月11日
摘要: #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #define ElementType int #define ERROR -1 /* 用链表表示栈 该栈初始是指向一个空节点 栈插入删除操作都是在链表头部形成栈结构 栈头一直指向 阅读全文
posted @ 2022-11-11 13:09 Rabbit_XIN 阅读(31) 评论(0) 推荐(0)
  2022年11月10日
摘要: #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #define ElementType int #define ERROR -1 typedef int Position; struct SNode{ ElementType * 阅读全文
posted @ 2022-11-10 23:17 Rabbit_XIN 阅读(46) 评论(0) 推荐(0)
  2022年11月8日
摘要: #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <time.h> /* 该链表不带头节点 第一个节点下标从0开始*/ #define ElementType int #define ERROR NULL typ 阅读全文
posted @ 2022-11-08 16:36 Rabbit_XIN 阅读(38) 评论(0) 推荐(0)
  2022年11月2日
摘要: #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #define ElementType int #define MAXSIZE 100 #define ERROR -1 typedef int Position; typedef 阅读全文
posted @ 2022-11-02 22:16 Rabbit_XIN 阅读(22) 评论(0) 推荐(0)
  2022年1月18日
摘要: 1 代表 X 0 代表 O 用到了遍历 import java.util.Scanner; // look at # game who win public class Hello { public static void main(String[] args) { Scanner in = new 阅读全文
posted @ 2022-01-18 19:19 Rabbit_XIN 阅读(75) 评论(0) 推荐(0)
  2022年1月17日
摘要: 利用枚举法 import java.util.Scanner; public class Hello { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt( 阅读全文
posted @ 2022-01-17 15:48 Rabbit_XIN 阅读(96) 评论(0) 推荐(0)