cxfans
9/6/2019 - 6:01 AM

Search_Seq

Search_Seq

#define ElemType int

typedef struct {
    ElemType *elem;
    int TableLen;
} SSTable;

int Search_Seq(SSTable ST, ElemType key) {
    int i;
    ST.elem[0] = key;
    for (i = ST.TableLen; ST.elem[i] != key; i--);
    return i;
}