码迷,mamicode.com
首页 >  
搜索关键字:面试    ( 19536个结果
LeetCode: Remove Duplicates from Sorted Array [025]
【题目】 Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. For example, Given input array A ...
分类:其他好文   时间:2014-05-18 18:25:19    阅读次数:272
LeetCode: Remove Element [026]
【题目】 Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length. 【题意】 删除数组中指定的值。不关心在新数组的后面即数组尾部留下了什么值。 【思路】 思路同Remo...
分类:其他好文   时间:2014-05-18 14:53:56    阅读次数:208
LeetCode: Divide Two Integers [028]
【题目】 Divide two integers without using multiplication, division and mod operator. 【题意】 计算两个数的商,不能使用乘、除、取余操作 【思路】 用加法,确定多少除数相加其和恰好<=被除数 为了提高算法效率,利用贪心思想,采用滚雪球式的翻倍叠加策略,使和快速逼近被除数 集中特殊情况需要注意: 1. 结果是负数 ...
分类:其他好文   时间:2014-05-18 10:42:00    阅读次数:259
LeetCode: Next Permutation [030]
【题目】 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). The replac...
分类:其他好文   时间:2014-05-18 09:54:53    阅读次数:242
LeetCode: Substring with Concatenation of All Words [029]
【题目】 You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters. For example, given: S:...
分类:其他好文   时间:2014-05-18 08:31:48    阅读次数:228
LeetCode: Implement strStr() [027]
【题目】 Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack. 【题意】 实现库函数strStr(), 功能是在字符串haystack中找出目标串needle第一次出现的索引位 【思路】 字符串的匹配,可以用暴力解法,但不推荐。一般使用KMP算法求解。 简要介绍一下KMP的思想: ...
分类:其他好文   时间:2014-05-18 04:10:04    阅读次数:244
理解JAVASCRIPT 闭包
最近去面试了一家企业,结果非常灰心丧气,于是周末给自己定了一个目标学好一门,学精通一门。不求多,只求懂。最近看到一个概念“闭包”。什么是闭包呢?简单一点就是:看得到多和看得到少的区别。上面这句话是我自己总结的,或许不太准确。你能看到的多少这句话该如何理解呢?下面随便丢一段代码:var name="P...
分类:编程语言   时间:2014-05-18 01:15:57    阅读次数:380
黑马程序员——Java面试题之银行业务调度系统
android培训、java培训、期待与您交流!对象分析:1.客户类按照业务分类,客户可以分成三类。publicenumCustommer{COMMON,VIP,EXPRESS;publicString toString(){String name=null;switch(t...
分类:编程语言   时间:2014-05-18 00:09:18    阅读次数:473
黑马程序员——Java面试题之交通灯调度系统
面对对象设计面对对象设计思想:把方法定义在合适的对象上。人在黑板上画圆,其实是调用圆的构造方法。司机刹车,实际上刹车的方法在车上面,我们只是调用刹车的方法,刹车的方法在车上。classCircle1{doubler;publicCircle1(doubler){this.r=r;}}new对象就能新...
分类:编程语言   时间:2014-05-17 21:36:06    阅读次数:451
面试中有关C++的若干问题
面试中有关C++的若干问题By 晴天, 2014.5.16晚什么是多态?简要说一下C++中的多态的概念。(1)定义:多态是指相同对象收到不同消息或者不同对象收到相同消息产生不同的行为。(2)C++中多态分为两种a) 编译时多态(静态绑定) 通过函数重载来实现b) 运行时多态(动态绑定) 通过虚函数来...
分类:编程语言   时间:2014-05-17 20:34:07    阅读次数:347
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!