恒生电子笔试题3(2)

时间:2025-03-11

恒生电子笔试题

return nNum; } else { struct NODE_LIST* pNew = sub_func(pTree, *ppList); int nTemp = 0; if (pTree->pLeft != NULL) { nTemp += func(pTree->pLeft, &pNew); if (pNew == NULL) { return -1; } } if (pTree->pRight != NULL) { nTemp += func(pTree->pRight, &pNew); if (pNew == NULL) { return -1; } } return nTemp + 1; } }

2. please complete the standard C function: memmove(), here is the description ():

void * memmove (void *to, const void *from, unsigned int size)

memmove copies the size bytes at from into the size bytes at to. The value returned by memmove is the value of to.

3. Given a decimal number, return the number in string of specified base (The base of a system of numbers, such as 2 in the binary system and 10 in the decimal system). The base is bigger than 1 and less than 10. For example, the given number is 99 in decimal, and return string “143” of base 8 (char* GetNumber(unsigned int nNum, unsigned int nBase) { }

4. Find a path from start position to end position in maze. The maze's width is 8, and height is 8 too, it is expressed by an two-dimensional array, the start position of it is left-up corner and its coordinate is (0, 0), and the end position is right-down corner and coordinate (7, 7). Each integer element in array defines connectivity of a block, 0 if disconnected, others

connected. For example, a path is painted in different color in the following maze expressed

恒生电子笔试题

of actual code), the array "maze" is the map of a maze, the size is 8*8. Save found path in "maze" before function return non-zero, if you find. And return 0 if there is no path which can reach end point. The returned "maze" shall be cleared with "0" except the path, as

int path(int maze[8][8]);

恒生电子笔试题3(2).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219