发布于 2014-10-02 15:40:02 | 224 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

百度(Baidu)中文搜索引擎

百度(Nasdaq简称:BIDU)是全球最大的中文搜索引擎,2000年1月由李彦宏、徐勇两人创立于北京中关村,致力于向人们提供“简单,可依赖”的信息获取方式。“百度”二字源于中国宋朝词人辛弃疾的《青玉案·元夕》词句“众里寻他千百度”,象征着百度对中文信息检索技术的执著追求。


2010百度校园招聘笔试题-技术类,感兴趣的同学参考下。

一、简答题
1. 简述树的深度优先遍历及广度优先遍历及其非递归实现的特点;
2. 找出以下程序中的bug:
#include <stdio.h>
#include <stdlib.h>
struct Record
{
int a;
int b;
};
int create(struct Record *p, int num)
{
p = new struct Record[num];
if (!p)
return -1;
else
return 0;
}
int Test()
{
struct Record *p = NULL;
int i;
int num;
printf("0x%08x\n", p);
scanf("Input record num:%d", &num);
if (create(p, num) < 0)
return -1;
printf("0x%08x\n", p);
for (i = 0; i < num; i++) {
p[i].a = 0;
p[i].b = 0;
}
return 0;
}
int main(void)
{
Test();
getchar();
return 0;
}
#include <stdio.h>
#include <stdlib.h>
struct Record
{
int a;
int b;
};
int create(struct Record *&p, int num)
{
p=NULL;
p = new struct Record[num];
if (!p)
return -1;
else
return 0;
}
int Test()
{
struct Record *p = NULL;
int i;
int num;
printf("0x%08x\n", p);
printf("Input record num:"); scanf("%d",&num);
if (create(p, num) < 0)
return -1;
printf("0x%08x\n", p);
for (i = 0; i < num; i++) {
p[i].a = 0;
p[i].b = 0;
}
delete []p;
return 0;
}
int main(void)
{
Test();
getchar();
return 0;
}
3. 有一台Mini计算机,内存大小为1K,CPU主频为1M(CPU状态每秒改变10的6次方次),问在这台计算机上可运行并且确定可以终止的程序的最长运行时间是多少?
给出思路及推理过程(可以做任何假设)。

二、算法设计
1. 某大型项目由n个组件N1, N2……Nn构成,每个组件都可以独立编译,但是某些组件的编译依赖于其它组件(即某些组件只能在其它组件编译完成后才能编译),设计算法给出统计过程。
2. 完成函数:
int maxnumstr(char *inputstr, char *outputstr)
函数功能:找出inputstr中的最长连续数字串存储到outputstr里并返回长度,如调用maxnumstr("123abc1234a", outputstr)后返回4且outputstr中为"1234"。

三、系统设计
URL(统一资源定位符)由site、path组成,并且有其它属性信息如访问时间等。
如:http://www.baidu.com/img/abc中site为http://www.baidu.com,path为/img/abc。
1. 设计系统存储100亿条URL信息;
2. 说明如何完成URL信息的添加、删除及修改;
3. 如何添加URL的属性信息;



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务