作业帮 > 综合 > 作业

写一算法求已知顺序表A中元素的最大值和次最大值.并编写C语言程序实现

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/30 10:36:22
写一算法求已知顺序表A中元素的最大值和次最大值.并编写C语言程序实现
#include
#include
void printFstAndSndValue(SeqList sq)
{
int firstmax = 0;
int secondmax = 0;
int i = 0;
if(sq.last == -1)
{
printf(“List is empty!”);
return;
}
firstmax = sq.data[0];
secondtmax = 0;
for(i=1; i