PTA作业集
大吕廿
这个作者很懒,什么都没留下…
展开
-
PTA 6-3 带头结点链栈的操作 (10分)
这个题太简单了 没有模拟直接上代码Status Push(LinkList L,ElemType e){ LinkList p; p = (LinkList)malloc(sizeof(struct LNode)); p->data = e; p->next = L->next; L->next = p;}Status Pop(LinkList L,Elem...原创 2020-03-25 14:56:56 · 1165 阅读 · 0 评论 -
PTA 6-2 另类循环队列 (20分)
全部代码#include <stdio.h>#include <stdlib.h>#include <string.h>#define ERROR -1typedef int ElementType;typedef enum { addq, delq, end } Operation;//typedef enum { false, true } ...原创 2020-03-25 14:53:22 · 3054 阅读 · 0 评论 -
PTA 6-1 在一个数组中实现两个堆栈 (20分)
全部代码#include <stdio.h>#include <stdlib.h>#include<string.h>#define ERROR 1e8typedef int ElementType;typedef enum { push, pop, end } Operation;//typedef enum { false, true } b...原创 2020-03-25 14:51:28 · 559 阅读 · 0 评论 -
PTA 6-4 两个有序链表序列的合并 (15分)
全部代码#include <stdio.h>#include <stdlib.h>typedef int ElementType;typedef struct Node *PtrToNode;struct Node { ElementType Data; PtrToNode Next;};typedef PtrToNode List;...原创 2020-03-08 20:40:23 · 2026 阅读 · 2 评论 -
PTA 6-3 链表拼接 (20分)
全部代码#include <stdio.h>#include <stdlib.h>struct ListNode { int data; struct ListNode *next;};struct ListNode *createlist(); /*裁判实现,细节不表*///自己写了一个 struct ListNode *createl...原创 2020-03-08 20:38:23 · 999 阅读 · 0 评论 -
PTA 6-2 删除单链表偶数节点 (20分)
全部代码#include <stdio.h>#include <stdlib.h>struct ListNode { int data; struct ListNode *next;};struct ListNode *createlist();struct ListNode *deleteeven( struct ListNode *head...原创 2020-03-08 20:37:26 · 1370 阅读 · 1 评论 -
PTA 6-1 顺序表操作集 (20分)
全部代码#include <stdio.h>#include <stdlib.h>#define MAXSIZE 5#define ERROR -1//typedef enum {false, true} bool;typedef int ElementType;typedef int Position;typedef struct LNode *List...原创 2020-03-08 20:35:28 · 1288 阅读 · 3 评论