9.28记雅虎中国广州笔试
先申明本人不是什么牛人,记录这些为了积累之后的笔试经验
笔试中的题目大部分是基础的数据结构和算法知识,凭借记忆记得
1. 排序
排序算法考了很多,其中集中考察的知识包括
1. 排序算法的稳定性,冒泡、快排、插入、选择。
2. 不同排序算法适用的场景,比如要排序的序列只有少数乱序的数字时用什么排序的效率相对高
2 编程语言基础
记忆考了下面几道题。。。
package lee.hao.review; public class Test2 extends Test1{ public static void print(){ System.out.println("222"); } public static void main(String arg[]){ //题目三 new Test1().print(); new Test2().print(); } }
package lee.hao.review; public class Test1 { private int size=6; public static int length=3; public static void print(){ System.out.println("111111"); } public static void main(String args[]) throws InterruptedException { new Test1().fo(); //题目一 //题目二 Thread t=new Thread(); t.start(); System.out.println("x"); t.wait(10000); System.out.println("y"); } void fo(){ int size=4; new TT().print(); } class TT{ void print(){ System.out.println(length*size); } } }
3 算法题
基本上都是剑指offer里面出过的题目
给一个数组,将所有数字组成最小的整数——————————剑指offer面试题33:
两个字符串的最长公共字串
能够分解到由2,3,5,7 组合成的数字叫做humble number,求第n个humble number是多少? ——————剑指offer面试题34:丑数
bool isHumbleNum(int num) { while(num%2==0) num/=2; while(num%3==0) num/=3; while(num%5==0) num/=5; while(num%7==0) num/=7; return (num==1)?true:false; } int getHumbleNum(int n) { int number=0; int found=0; while(found<n) { number++; if(isHumbleNum(number)) { found++; } } return number; }