浙大PTA 4-2
来源:互联网 发布:钱龙分析软件 编辑:程序博客网 时间:2024/06/05 20:31
List MakeEmpty(){List L;L=(List)malloc(sizeof(List));L->Last=-1;return L;}Position Find( List L, ElementType X ){for(int i=0 ;i<=L->Last ;i++){if(L->Data[i]==X){return i;}}return ERROR;}bool Insert( List L, ElementType X, Position P ){if(L->Last==MAXSIZE-1){printf("FULL");return false;}else if(P<0||P>L->Last+1){printf("ILLEGAL POSITION");return false; }else{for(int i=L->Last ;i>=P ;i--){L->Data[i+1] = L->Data[i];}L->Data[P] = X;L->Last++; return true;}}bool Delete( List L, Position P ){if(P<0||P>L->Last){printf("POSITION %d EMPTY",P);return false;}else{for(int i=P ;i<L->Last ;i++){L->Data[i] = L->Data[i+1];}L->Last--;return true;}}
0 0
- 浙大PTA 4-2
- 浙大PTA 4-4
- 浙大PTA 4-3
- 浙大 PTA 4-12
- 浙大PTA OJ漏洞
- 浙大PTA数据结构Pop Sequence
- PTA 数据结构2-4
- 浙大pta: Build A Binary Search Tree
- 浙大 PTA 5-39 魔法优惠券 (25分)
- 4-2 多项式求值 (15分) PTA
- 浙大 数据结构基础 week3 4-2
- 浙大数据结构基础 week3 4-2
- PTA 4-1 Deque
- PTA ShortestPath[4]
- PTA训练(2)
- PTA-基础巩固2
- 最短路PTA(2)
- PTA
- Codeforces Round #375 (Div. 2) -- E. One-Way Reform(dfs求欧拉回路)
- asa hacker
- 算法设计 -- 递归
- 浙大PTA 4-3
- Java接口中的成员变量为什么必须是public static final?
- 浙大PTA 4-2
- 用C++自制的源码统计工具
- Linux工具CRT的安装
- Two Stacks In One Array
- Day 28:Fail to get up
- Docker Common Commands
- 计算广告方式
- POJ 1379 Run away & POJ 2420 A star not a Tree [模拟退火] [爬山算法]
- [LeetCode]409. Longest Palindrome