数据结构--每天一题-王道&&西南科技大学 -合并有序顺序表
合并有序顺序表
王道:将两个有序顺序表合并为一个新的有序顺序表,并有函数返回结果顺序表。要求时间复杂度O(n)
出处:除了王道
西南科技大学oj
删除顺序线性表中重复元素,可以运行的!!!!!
tips:后缀必须cpp
创建一个新的顺序表存放,归并排序
// An highlighted block
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MaxSize 50
typedef int ElemType;
typedef struct {
ElemType data[MaxSize];
int length;
}SqList;
void PrintList(SqList& L)
{
for (int i = 0; i < L.length; i++)
{
printf("%d", L.data[i]);
}