上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: /* sequenceQueue.c */ /* 顺序队列 */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #define MAXSIZE 100 /* 顺序循环队列数据结构 */ /* 一个圆圈,front指向队列头,rear指向队列尾 */ /* front -> ... -> rear data[0] -> dat 阅读全文
posted @ 2019-09-09 18:46 no樂on 阅读(925) 评论(0) 推荐(0) 编辑
摘要: /* recursion.c */ /* 递归 */ #include <stdio.h> void interface(void); /* 斐波那契数列以及阶乘函数声明 */ long long factorial(int n); void fibonacci(int x, int y, int stop); int main(){ int flag, number; interface(); 阅读全文
posted @ 2019-09-09 15:59 no樂on 阅读(268) 评论(0) 推荐(0) 编辑
摘要: /* linkStack.c */ /* 链栈 */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> /* 链栈数据结构 */ /* ———————————————— | value | next | < top ———————————————— ↓ ———————————————— | value | next | ———— 阅读全文
posted @ 2019-09-09 15:37 no樂on 阅读(1187) 评论(0) 推荐(0) 编辑
摘要: /* sequenceStack.c */ /* 栈 先进后出(First In Last Out,FILO)*/ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #define MAXSIZE 100 /* 栈数据结构 */ /* —————————— | data[2] | < top ——————————— | ———— 阅读全文
posted @ 2019-09-09 15:36 no樂on 阅读(952) 评论(0) 推荐(0) 编辑
摘要: /* sequenceList.c */ /* 顺序表 */ /* 线性表的顺序存储是指在内存中用地址连续的一块存储空间顺序存放线性表中的各项数据元素,用这种存储形式的线性表称为顺序表。 */ #include #include #include #define MAXSIZE 10 /* 顺序表结构 */ typedef struct { int data[MAXSIZE]... 阅读全文
posted @ 2019-09-09 14:06 no樂on 阅读(1361) 评论(0) 推荐(0) 编辑
摘要: /* maxCommonFactor.c */ /* 最大公因子数 */ #include <stdio.h> int maxCommonFactor(int m, int n); int main(){ int m, n; printf("Enter two integers: "); scanf("%d %d", &m, &n); printf("max common factor: %d\n 阅读全文
posted @ 2019-09-09 11:25 no樂on 阅读(447) 评论(0) 推荐(0) 编辑
摘要: /* singlyLinkedList.c */ /* 单链表 */ /* 单链表是一种链式存取的数据结构,用一组地址任意的存储单元存放线性表中的数据元素。 */ #include #include #include /* 节点结构 */ /* head ———————————————— | value | next | -> ... ——... 阅读全文
posted @ 2019-09-08 23:50 no樂on 阅读(652) 评论(0) 推荐(0) 编辑
摘要: package basic; import java.util.Scanner; public class Palindrome{ public static boolean isPalindrome(String raw){ String str = ""; // 只拿raw字符串里的字母,拼接到str里 for(int i = 0; i < raw.length(); i++){ char c 阅读全文
posted @ 2019-09-07 22:23 no樂on 阅读(1249) 评论(0) 推荐(0) 编辑
摘要: /* swap.c */ /* function swap to swap two numbers */ #include <stdio.h> void swap(int*, int*); void swapBit(int*, int*); int main(){ int x, y; printf("Please enter two numbers: "); scanf("%d %d", &x, 阅读全文
posted @ 2019-09-07 15:22 no樂on 阅读(251) 评论(0) 推荐(0) 编辑
摘要: package generics; import java.util.Arrays; // 泛型类 -> 动态数组 public class DynamicArray<E>{ // field private static final int DEFAULT_CAPACITY = 10; private int size; private Object[] elementData; // cons 阅读全文
posted @ 2019-09-05 19:25 no樂on 阅读(1221) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页