题目:https://pintia.cn/problem-sets/15/problems/727

题目设定查找失败返回error 为-1

ElementType FindKth( List L, int K ){
int sum = 0;
while(L!=NULL){
sum++;
if(sum == K){
return L->Data;
}
L = L->Next;
}
return -1;
}
链表的查找

相关文章:

  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-01-02
  • 2021-07-24
猜你喜欢
  • 2021-08-20
  • 2022-12-23
  • 2021-12-08
  • 2022-01-28
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
相关资源
相似解决方案