注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
打电话,就在google doc出题写码。题目不难但是都很长。
1. List ways you can use an int[] to keep track of a bunch of integers so that you can quickly answer the question if a particular integer is in that bunch.
To conceptualize: class X { int[] storage; // other members if you like, but main storage should be int[] X(Collection<Integer> numbers) { // Setup }
public boolean contains(int v) { // this needs to be fast } }
Provide complexities (big-O notation) of lookup, storage required, and storage setup time.
| lookup O(?) | ..
}}
Example: toAnalyze = A.class, B.class
calling findDependencies for A.class returns C.class, D.class calling findDependencies for B.class returns C.class, E.class calling findDependencies for C.class returns D.class, F.class calling findDependencies for D.class returns E.class, F.class calling findDependencies for F.class returns E.class calling findDependencies for E.class returns {empty collection}
You should return: A.class,B.class,C.class,D.class,E.class,F.class (in any order)
|
上一篇:Amazon Oa2+Video 感恩节前要感恩 下一篇:Facebook 2面已跪 分享面经 求安慰啊
|