摘要:
1.阶乘 使用循环实现: def factorial(n): result = n for i in range(1, n): result *= i return result 使用函数递归实现: def factorial(n): if n == 1: return 1 else: return 阅读全文
摘要:
typedef struct LNode { int data; struct LNode *next; }LNode, *LinkList; 带头结点的按位序插入: //在第i个位置插入元素e bool ListInsert(LinkList &L, int i, char e) { if (i 阅读全文
摘要:
插入与删除: #include <stdio.h> #define MaxSize 10 typedef struct { int data[MaxSize]; int length; }SqList; bool ListInsert(SqList &L, int i, int e) { if (i 阅读全文