奇虎360 2015校园招聘笔试编程题

奇虎360校园招聘2015笔试题目 阅读详情

题目一:

写一个函数,根据两文件的绝对路径算出相对路径。
如a="/qihoo/app/a/b/c/d/new.c",b="/qihoo/app/1/2/test.c",
那么b相对于a的相对路径是"../../../../1/2/test.c"
#include <stdio.h>
#include <string.h>

int isGoodPath( char *path )
{
    if ( path == NULL || *path != '/' )
        return 0;
    return 1;
}

//the relative path of b 
void parseRelativePath( char *patha, char *pathb, char *result )
{
    if ( !isGoodPath( patha ) || !isGoodPath( pathb ) )
        return ;
    int diff, i = 0;
    int tempdiff;
    int dirDiff = 0;
    //找到路径中最后一个相同的目录
    while ( *(patha+i) == *(pathb+i) )
    {
        if ( *(patha+i) == '/' )
        {
            diff = i;
        }
        i++;
    }
    diff++;
    tempdiff = diff;
    //计算出..的个数
    while ( *(patha+diff) != '\0' )
    {
        if ( *(patha+diff) == '/' )
            dirDiff++;
        diff++;
    }
    //拼接出结果
    while ( dirDiff != 0 )
    {
        strcat( result, "../" );
        dirDiff--;
    }
    strcat( result, pathb+tempdiff );
}


int main( void )
{
    char *patha = "/qihoo/app/a/b/c/d/new.c";
    char *pathb = "/1/2/test.c";

    char result[1024];

    parseRelativePath( patha, pathb, result );

    printf( "%s\n", result );
    return 0;
}

题目二:

有一个二维float型矩阵,有m行n列,每一个行和列上都是递减序列,
请编程实现在这个矩阵中查找值等于v的元素的函数,如果找到返回其下标

分析:
1、浮点数比较大小。
2、必须以右上角或者左下角为起点。

#include <stdio.h>
#include <math.h>
#include <unistd.h>

//row -> m, column -> n
int findFromMatrix( float target, float *matrix, int m, int n )
{
    const float REALZERO = 10.0e-6;
    const float PREALZERO = -1 * 10.0e-6;
    for ( int i = 0, j = n-1; j >= 0 && i < m;  )
    {
        printf( "i : %d\n", i );
        printf( "j : %d\n", j );
        sleep(1);
        if ( fabs(matrix[i*m+j] - target) < REALZERO )
        {
            return i*m+j;
        }
        else if ( matrix[i*m+j] - target < PREALZERO )
        {
            i++;
        }
        else
        {
            j--;
        }
    }
    return -1;
}

int main( void )
{
    float matrix[] = { 1.0, 2.0, 8.0, 9.0, 2.0, 4.0, 9.0, 12.0, 4.0, 7.0, 10.0, 13.0, 6.0, 8.0, 11.0, 15.0 };
    float target = 4.0;
    int index = findFromMatrix( target, matrix, 4, 4 );
    printf( "%d\n", index );
    return 0;
}

题目三:

字符串A和B的最长公共单词

这道题不清楚题意是求最长公共子序列还是将字符串分隔为单词,然后求两个字符串中共有的字符串里面最长的。
我将两种情况下的思路和代码都写下来。

1、求字符串A和B的最长公共子序列。
这是个经典题目,要使用到动态规划。

关于动态规划,参考这里:动态规划

2、将字符串分隔为单词,然后求两个字符串中共有的字符串里面最长的。
这种解决方法,我能想到的思路就是将每个句子中的单词分析出来保存到一个数组中,然后将这两个数组中的单词进行比较,这样的时间复杂度能达到O(m*n),时间效率非常低,还没有遇到什么有效地解法,由于解法很直观就不用关注代码了。

Java工程师笔试题整理[校招篇] Java工程师笔试题整理[校招篇] 阿里巴巴 2016阿里巴巴2016研发工程师笔试题(四)阿里巴巴2016研发工程师笔试题(三)阿里巴巴2016研发工程师笔试题(二) 2015阿里巴巴2015实习生笔试题阿里巴巴2015系统工程师研发笔试题阿里巴巴2015基础平台研发工程师实习生笔试题阿里巴巴2015研发工程师A笔试卷阿里巴巴2015研发工程师B笔试卷 腾讯 2017腾讯... 阅读详情

相关推荐

基于高精度三维机器视觉的新能源汽车锂电池表面缺陷检测

在机器视觉行业迅速发展的背景下,市场上提供了功能强大且种类齐全的3D相机系列,可以满足锂电池从电芯到模组各个工艺和工位的3D检测需求。

Hinyeung_Limited的博客 1133

【2015年奇虎360|绿盟科技|唯品会|4399秋招岗位分析及内推】一大波网络|安全|运维岗位来袭~...

2015年华为网申截止提醒①华为的网申页面:http://career.huawei.com/recruitment/campus.html,之前说明是9月3号截止网申,这两天上去看,发布时间又更新为9月1号,不管怎样,建议大家还是先投递吧。按照拼客科技这边的经验(内部已经有3枚学员入职华为),我们前两年投递的岗位是:技术服务工程师和销售解决方案经理,都是大家学习网络和安全这...

weixin_33826609的博客 1049

嵌入式存储实战:FAL+SFUD+flashDB三件套在STM32上的完整移植指南(附避坑技巧)

本文提供了一套在STM32上完整移植FAL、SFUD与flashDB嵌入式存储框架的实战指南。详细解析了从SPI驱动配置、SFUD设备识别、FAL抽象层分区到flashDB键值数据库初始化的全流程,并分享了关键的避坑技巧与性能优化建议,帮助开发者构建稳定可靠的嵌入式存储系统。

rnn9storyteller的博客 1017

2015年全部企业校园招聘情况+薪资水平!

15年企业校园招聘已经开始啦,小伙伴们准备好了么?下面是所有企业的招聘情况,要想快人一步就业就要先人一步分享此文章!担心自己能力不够?别怕,来传智找播妞!让你轻松搞定所有互联网企业! 互...

黑马程序员官方博客 652

树莓派+STM32+激光雷达:大学生工训赛智能物流小车全栈开发实录(附避坑指南)

本文详细记录了基于树莓派、STM32和激光雷达的智能物流小车全栈开发过程。文章从系统架构设计、硬件集成、软件框架搭建到机械臂控制与视觉辅助定位,系统阐述了如何构建一个完整的机器人系统,并分享了在电源管理、通信延迟、里程计误差等关键环节的实战避坑指南,为嵌入式与机器人开发提供了宝贵经验。

kotlin6android的博客 748

DEXPI与Proteus XML:解锁过程工业P&ID数据互操作性的技术核心

本文深入探讨了DEXPI与Proteus XML在过程工业P&ID数据互操作性中的核心技术。通过解析DEXPI标准的开源特性和Proteus XML的架构设计,揭示了其在跨平台数据交换中的关键作用,并结合CADMATIC和西门子COMOS的实战案例,展示了如何实现高效的数据集成与转换。

weixin_29195615的博客 385

90 个名企笔试题 + 算法题

名企笔试 名企笔试:美团2016招聘笔试(股票交易日) 名企笔试:搜狐2016招聘笔试题(扎金花) 名企笔试:凤凰网2015招聘(二分查找) 名企笔试:4399游戏校招笔试题(快速排序) 名企笔试:蘑菇街2016招聘笔试(回文串) 名企笔试:网易招聘笔试(升级之路) 名企笔试 : 完美世界招聘笔试(子序列)

qq_15505637的博客 1727

永久关闭Windows更新的5种方法

很多家用电脑,如果系统自动更新的话,会变得越来越卡顿,且硬件型号兼容也并不完美。那么我们该如何彻底关闭Win11的自动更新呢?以下准备了5种方法,您可以根据自身实际情况选择合适的方法!

qq_43652793的博客 1万+

90 个名企笔试题和算法题

名企笔试 名企笔试:美团2016招聘笔试(股票交易日) 名企笔试:搜狐2016招聘笔试题(扎金花) 名企笔试:凤凰网2015招聘(二分查找) 名企笔试:4399游戏校招笔试题(快速排序) 名企笔试:蘑菇街2016招聘笔试(回文串) 名企笔试:网易招聘笔试(升级之路) 名企笔试 : 完美世界招聘笔试(子序列)

ZCC的专栏 1209

【2022KaliLinux】openvas/gvm 没有scan configs 或者是 scan config error “XXXXXXXXXXX”

gvm/openvas的configuration的scan config为空

zbossz的学习小分队 3607

28、基于图像快速序列视觉呈现(RSVP)的脑机接口特征提取与分类算法综述

本文综述了基于图像快速序列视觉呈现(RSVP)的脑机接口(BCI)中的特征提取与分类算法。RSVP技术通过快速连续呈现图像序列,结合脑电图(EEG)信号分析,实现对目标图像的识别和标记。文章详细介绍了RSVP实验的设计、EEG数据的采集与预处理,并探讨了低信噪比、维度灾难、重叠epoch和不平衡数据集等挑战。针对特征提取,讨论了有监督空间滤波方法(如CSP、xDAWN、LDA波束形成器)的原理和应用。在分类策略部分,涵盖了线性分类技术(如LDA、BLR、LR、SVM)和非线性分类方法(如MLP、CNN)。文

hh234的博客 337

收藏 90 个名企笔试题 + 算法题

收藏 90 个名企笔试题 + 算法题

qq_43668159的博客 425

RK3399外设驱动之MIPI

RK3399外设驱动之MIPI 文章目录RK3399外设驱动之MIPIMIPI命令解析入口代码mipi显示配置实例rk3399mipi驱动rk mipi驱动注册过程rk32_mipi_dsi.c解析 内核版本 Linux4.4 平台 rk3399 作者 nineyole MIPI命令解析入口代码 MIPI的入口代码如下:kernel\drivers\video\rockchip\screen\lcd_mipi.c static int __init rk_mipi_screen_in

学无止境 2229

2015秋季校园招聘 IT公司笔试题

1.奇虎360 9.15 1.因数分解 #include #include #include int Num=1000; int zhishu[1000]; int calculateZhishu(){ // zhishu=(int*)malloc(sizeof(int)*Num); Num=1; zhishu[0]=2; for(int i=3;i<1000;i++){ b

Hard Working 930

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

收藏!90 个名企笔试题 + 算法题

名企笔试名企笔试:美团2016招聘笔试(股票交易日)名企笔试:搜狐2016招聘笔试题(扎金花)名企笔试:凤凰网2015招聘(二分查找)名企笔试:4399游戏校招笔试题(快速排序)名企笔试:蘑菇街2016招聘笔试(回文串)名企笔试:网易招聘笔试(升级之路)名企笔试 : 完美世界招聘笔试(子序列)名企笔试:华为校招笔试题(字符集合)名企笔试:楚楚街2016招聘笔试(旅途)名气笔试:楚楚街2016招聘笔...

weixin_41795820的博客 1642

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

搬:90 个名企笔试题和算法题

名企笔试 名企笔试:美团2016招聘笔试(股票交易日) 名企笔试:搜狐2016招聘笔试题(扎金花) 名企笔试:凤凰网2015招聘(二分查找) 名企笔试:4399游戏校招笔试题(快速排序) 名企笔试:蘑菇街2016招聘笔试(回文串) 名企笔试:网易招聘笔试(升级之路) 名企笔试 : 完美世界招聘笔试(子序列) 名企笔试...

hunter 261

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

收藏90个名企面试算法题

名企笔试 名企笔试:美团2016招聘笔试(股票交易日) 名企笔试:搜狐2016招聘笔试题(扎金花) 名企笔试:凤凰网2015招聘(二分查找) 名企笔试:4399游戏校招笔试题(快速排序) 名企笔试:蘑菇街2016招聘笔试(回文串) 名企笔试:网易招聘笔试(升级之路) 名企笔试 : 完美世界招聘笔试(子序列)

orangeTop的博客 1185

百度、阿里巴巴、腾讯等18家名企2016年校招计划出炉

互联网 1、阿里巴巴 网申: https://campus.alibaba.com/index.htm 校招微博: @阿里巴巴集团校园招聘 申请时间:7月1日-8月15日 流程:网申——笔试——面试——入职 2、百度 网申: http://talent.baidu.com 校招微博:@百度招聘 申请时间:8月15日-10月10日 流程:选择笔面试城

renxingzhadan的专栏 2506

目录:名企笔试 + 算法题

名企笔试:美团2016招聘笔试(股票交易日)名企笔试:搜狐2016招聘笔试题(扎金花)名企笔试:凤凰网2015招聘(二分查找)名企笔试:4399游戏校招笔试题(快速排序)名企笔试:蘑菇街2016招聘笔试(回文串)名企笔试:网易招聘笔试(升级之路)名企笔试 : 完美世界招聘笔试(子序列)名企笔试:华为校招笔试题(字符集合)名企笔试:楚楚街2016招聘笔试(旅途)名气笔试:楚楚街2016招聘笔试(解密...

notOnlyRush的博客 572
上一篇: 虚拟内存(占坑)
下一篇: linux命令集合
Findway_
博客等级 码龄10年 36粉丝 117原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值