任何人都可以帮助我将下面的C代码转换为MIPS代码吗?我应该使用递归并得到21-2作为最终答案。谢谢!C到MIPS转换
/*
x is a pointer to a linked list node and is not null.
Return the min value stored in the linked list.
Assume each node is stored in memory as an int (value) followed by a pointer to the next node (next), each a word wide.
You must write it with recursion. */
int findMin(node *x) {
if(x->next == NULL)
return x->value;
else {
int min = findMin(x->next);
if(min < x->value)
return min;
else
return x->value;
}
}
...使用编译器? – 2013-03-11 05:25:30
这是功课吗? – tjameson 2013-03-11 05:27:02
@tjameson评论的第二段绝对是教授或助教使用的语句。 – 2013-03-11 05:44:23