顺丰科技2019秋招Java开发工程师客观题合集
时长:120分钟 总分:74分
387浏览 1人已完成答题
题型介绍
题型 | 单选题 | 多选题 |
---|---|---|
数量 | 24 | 13 |
二叉排序树的链表节点定义如下: typedef struct BiTnod...
typedef struct BiTnode{ int key_value struct BiTnode *L,*R/*节点的左、右树指针*/ }
请补充完整查找键值key的函数。
BSTree lookup_key(BSTree root,int key) { if() return NULL else if(key == root->key_value) return root else if(key > root->key_value) return (1) else return (2) }
设有递归算法如下,最终打印结果是()
#include
#include<stdio.h> int foo(int a ,int b) { if (b == 0) return 0 if (b % 2 == 0) return foo(a+a,b/2) return foo(a+a,b/2)+a } int main() { printf("%d", foo(1,3)) return 0 }
此代码片段输出正确的值是()
public class CharToString { public static void main(String[] args) { char myChar = 'g' String myStr = Character.toString(myChar) System.out.println("String is: "+myStr) myStr = String.valueOf(myChar) System.out.println("String is: "+myStr) } }此代码片段输出正确的值是()
一个空栈,如果有顺序输入:a1,a2,a3...an(个数大于3),而且输出第一个为 a(n-1), 那么所有元素都出栈后,()
总部给某分公司分配的网络地址是172.16.2.0/24,该分公司有三个部...
甲乙丙3个进程对某类资源的需求分别是7个、8个、3个。且目前已分别得到了3...
某打车公司将驾驶里程(drivedistanced)超过5000里的司机信...
文法G[E]: E-> T|E+T|E - T T-> F|T...
E-> T|E+T|E - T T-> F|T*F|T/F F ->(E)|i以下论述正确的是()
文法G[E]: E-> T|E+T|E - T T-> F|T...
E-> T|E+T|E - T T-> F|T*F|T/F F ->(E)|i以下论述正确的是()
下面程序的运行结果()       &nbs...
List<String> aa = new ArrayList<String>() aa.add("F1") aa.add("F2") aa.add("F3") for (String temp : aa) { if ("F3".equals(temp)) { aa.remove(temp) } } for (String temp : aa){ System.out.println(temp) }
下面程序的运行结果() &nbs...
Object obj=new Object() List aList=new ArrayList() List bList=new LinkedList() long t1=System.currentTimeMillis() for(int i=0i<50000i++){ aList.add(0,obj) } long t2=System.currentTimeMillis()-t1 t1=System.currentTimeMillis() for(int i=0i<50000i++){ bList.add(0,obj) } long t3=System.currentTimeMillis()-t1
以下关于Java里面泛型说法正确的是
下面程序的运行结果是() public class ClassA { &n...
public class ClassA { static int count = 0 static { count++ System.out.println("A") } public ClassA() { System.out.println("B") } } public class ClassB { static { ClassA t2 System.out.println("C") } public static void main(String[] args) { Class c1 Class c2 Class c3 try { c1 = ClassA.class c2 = Class.forName("ClassA") ClassA a = new ClassA() c3 = a.getClass() } catch (ClassNotFoundException e) { e.printStackTrace() return } if (c2 == c1&& c1 == c3) { System.out.println("D") } else { System.out.println("E") } System.out.println(ClassA.count) } }
开闭原则相关的面向对象设计原则()
有以下结果表tt_tmp,数据如下 gt,result ---------...
gt,result
-----------------------
2018-05-19 S
2018-05-19 S
2018-05-19 F
2018-05-19 F
2018-05-20 S
2018-05-20 F
2018-05-20 F
需要统计以下结果
gt success failure
2018-05-19 2 2
2018-05-20 1 2
sql语句怎么写()
sum(case when result='F' then 1 else 0 end)'failure' from tt_tmp group by gt
(select gt,count(*) as 'success' from tt_tmp where result='S'group by gt) s inner join
(select gt,count(*) as 'failure' from tt_tmp where result='F'group by gt)
on s.gt=f.gt
sum(case when result='S' then 1 else 0 end)'failure' from tt_tmp group by gt
(select gt,count(*) as 'success' from tt_tmp where result='S'group by gt) s,
(select gt,count(*) as 'failure' from tt_tmp where result='F'group by gt) f where s.gt=f.gt
以下程序输出() public static void main(Stri...
public static void main(String[] args) { int num = 2 switch (num) { case 1: ++num case 2: ++num case 3: ++num default: ++num break } System.out.println(num) } }
分析以下代码,说法正确的是()  public static v...
public static void main(String[] args) { System.out.println(val()) } public static int val() { int num = 5 try { num = num / 0 } catch (Exception e) { num = 10 } finally { num = 15 } return num }