//============================================================================
// Name :algorithm2_6.cpp
// Author :Gao_Xiong
// Version :Visual Studio2012
// Copyright : all rights reserved
// Description : 在顺序线性表L中查找第1个值与e满足compare()的元素的位序
// 若找到,则返回其在L中的位序,否则返回0
//============================================================================
#include <iostream>
#include<cstdlib>
#include<cstdio>
using namespace std;
#define LIST_INIT_SIZE 100 //线性存储空间的初始分量
#define LISTINCREMENT 10 //线性表存储空间的分配增量
typedef int ElemType;
struct SqList{
ElemType *elem; //存储空间基址
int length; //当前长度
int listsize; //当前分配的存储容量(以sizeof(ElemType)为单位)
};
int InitList_Sq(SqList &L)
{
数据结构之算法2.6-在顺序线性表L中查找第1个值与e满足compare()的元素的位序
最新推荐文章于 2023-02-06 16:48:00 发布