正在加载图片...
下例循环的循环不变式是什么吗? QUOTE: Vector <int>list(n);//n is some positive integer <code which assigns values to all entries in list> int k,indexMax; indexMax =0; for(k 1;k list.length();k++){ //invariant true here if (list[k]>list[indexMax]) indexMax k; }下例循环的循环不变式是什么吗? QUOTE: Vector <int> list(n); // n is some positive integer <code which assigns values to all entries in list> int k, indexMax; indexMax = 0; for(k = 1; k < list.length(); k++){ // invariant true here if (list[k] > list[indexMax]) indexMax = k; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有