请问这段代码应该修改成什么样才符合题意?
利用二分查找算法在线性表list(学生情况表)中查找给定值key(学号)的结点,并对该结点的部分数据进行修改。(学生情况表list包含学生的学号、姓名、课程名、课程成绩)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef int KeyType;
typedef int Status;
//数据元素类型定义
typedef struct {
KeyType key;
}ElemType;
//定义顺序表List
typedef struct {
ElemType* R;//存储空间基地址
int length;//当前长度
}SListTable;
//二分查找+递归算法
int Search_Bin(SListTable List, KeyType key, int low, int high)
{
/*int array[11]{5, 13, 19, 21, 37, 56, 64, 75, 80, 88, 92};
index = Search_Bin(array[], 80, 0, array[].length - 1);
printf("%i", &index);*/
if (low > high) {
return -1;//查找不到时返回-1
}
int mid = (low + high) / 2;
if (key == List.R[mid].key)
{
return mid;
}
else if (key > List.R[mid].key)
{
Search_Bin(List,key,high,mid - 1);//递归
}
else
{
Search_Bin(List,key,low,mid + 1);//递归
}
return 0;
}
int main()
{
SListTable List;
int j, key;
j = Search_Bin(List,key);
return 0;
}