查找专项练习
查找专项练习 20 题:顺序/二分查找 ASL、KMP nextval、图的遍历、Integer 缓存等。(题目与解析为参考(自拟),非官方标准答案。)
下列有关图的遍历说法中,不正确的是
下面哪个不是标准Statement类?
Suppose that a Selection Sort of 80 items has completed 32 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)?
list是一个ArrayList的对象,哪个选项的代码填到//todo delete处,可以在Iterator遍历的过程中正确并安全的删除一个list中保存的对象?()
Iterator it = list.iterator();
int index = 0;
while (it.hasNext())
{
Object obj = it.next();
if (needDelete(obj)) //needDelete返回boolean,决定是否要删除
{
//todo delete
}
index ++;
}
若查找每个记录的概率均等,则在具有n个记录的连续顺序文件中采用顺序查找法查找一个记录,其平均查找长度ASL为()
void waitForSignal()
{
Object obj = new Object();
synchronized(Thread.currentThread())
{
obj.wait();
obj.notify();
}
}
Which statement is true?
若有序表的关键字序列为(b,c,d,e,f,g,q,r,s,t),则在二分查找关键字b的过程中,先后进行的关键字依次为:
有关下述Java代码描述正确的选项是____。
public class TestClass {
private static void testMethod(){
System.out.println("testMethod");
}
public static void main(String[] args) {
((TestClass)null).testMethod();
}
}
下面关于二分查找的叙述中正确的是:
下面有个hibernate延迟加载,说法错误的是?
具有12个关键字的有序表,折半查找的平均查找长度()
有这么一段程序:
public class Test{
public String name="abc";
public static void main(String[] args){
Test test=new Test();
Test testB=new Test();
System.out.println(test.equals(testB)+","+test.name.equals(testB.name));
}
}
请问以上程序执行的结果是()
顺序查找的平均时间是多少?
有如下4条语句:()
Integer i01=59;
int i02=59;
Integer i03=Integer.valueOf(59);
Integer i04=new Integer(59);
以下输出结果为false的是:
字符串′ababaabab′的nextval为()
以下各类中哪几个是线程安全的?( )
串′ababaaababaa′的next数组为()
对于线程局部存储TLS(thread local storage),以下表述正确的是
在ASC算法team日常开发中,常常面临一些数据结构的抉择,令人纠结。目前大家在策划一个FBI项目(Fast Binary Indexing),其中用到的词汇有6200条,词汇长度在10-15之间,词汇字符是英文字母,区分大小写。请在下面几个数据结构中选择一个使检索速度最快的:
以下关于对象序列化描述正确的是