由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - complexity of a recursive
相关主题
node.js multer: Recursive process.nextTick detected关于tcp包头的一个小问题 [图] (转载)
reverse LL recursively请问strcpy()和memcpy()的写法问题  (转载)
[合集] 问个递归的问题哪位帮忙看一个极为简单的 MPI 程序,感谢拉!
Python: What does this mean?一道笔试题
recurvion真的很难懂~~3 c++ challenge-and-grill questions
树的前序遍历A tough pointer concept
SQL questionandroid上几个常用的image处理方法
问个简单的memory allocation 的问题。好奇下面的code是什么语言写的,能帮忙识别下吗?文件是 .mm
相关话题的讨论汇总
话题: dimsize话题: int话题: dest话题: ndim
进入Programming版参与讨论
1 (共1页)
l*******d
发帖数: 101
1
网上下的一段程序。需要分析复杂度。中间的循环完全把我绕糊涂了。该怎样想呢?
谢谢回帖!
void repmat(char *dest, const char *src, int ndim, int *destdimsize,
int *dimsize, const int *dims, int *rep)
{
int d = ndim-1;
int i, chunk;
/* copy the first repetition into dest */
if(d == 0) {
chunk = dimsize[0];
memcpy(dest,src,chunk);
}
else {
/* recursively repeat each slice of src */
for(i=0;i repmat(dest + i*destdimsize[d-1], src + i*dimsize[d-1],
ndim-1, destdimsize, dimsize,
1 (共1页)
进入Programming版参与讨论
相关主题
好奇下面的code是什么语言写的,能帮忙识别下吗?文件是 .mmrecurvion真的很难懂~~
这段代码花很长时间,为什么?树的前序遍历
nodejs multer file upload后如何管理此文件,不跟以前的冲突?SQL question
a question about CGI问个简单的memory allocation 的问题。
node.js multer: Recursive process.nextTick detected关于tcp包头的一个小问题 [图] (转载)
reverse LL recursively请问strcpy()和memcpy()的写法问题  (转载)
[合集] 问个递归的问题哪位帮忙看一个极为简单的 MPI 程序,感谢拉!
Python: What does this mean?一道笔试题
相关话题的讨论汇总
话题: dimsize话题: int话题: dest话题: ndim