一个计算机算法称为高效的,如果它的时间复杂度是()。
未知类型:{'options': ['O([img=14x14]17e0c262a3e1ab2.jpg[/img])', ' O([img=16x18]17e0a6d25e02f0a.jpg[/img])', ' O(n!)'], 'type': 102}
未知类型:{'options': ['O([img=14x14]17e0c262a3e1ab2.jpg[/img])', ' O([img=16x18]17e0a6d25e02f0a.jpg[/img])', ' O(n!)'], 'type': 102}
举一反三
- 在长度为n的线性表中查找值为x的数据元素,其时间复杂度为:()。 未知类型:{'options': ['O(0)', ' O(1)', ' O(n)', ' O([img=16x18]17e0a6d25e02f0a.jpg[/img])'], 'type': 102}
- 下面程序段的时间复杂度。x=n;//n>;1y=0;while(x≥(y+1)* (y+1))y++; 未知类型:{'options': ['O([img=21x19]17e43f24c5c98a6.jpg[/img])', ' O(1)', ' O([img=16x18]17e436db6f18ee9.jpg[/img])', ' O(logn)'], 'type': 102}
- 在长度为n的单链表中插入一个元素操作算法时间复杂度为()。 未知类型:{'options': ['O(1)', ' O(n)', ' O(logn)', ' O([img=16x18]17e0a6d25e02f0a.jpg[/img])'], 'type': 102}
- 求以下算法的时间复杂度。void func1(int n){ int x=0, i;for (i=1;i<;=n;i++)for(j=i+1;j<;=n;j++)x++;} 未知类型:{'options': ['O(1)', ' O(n)', ' O([img=16x18]17e436db6f18ee9.jpg[/img])', ' O([img=13x14]17e43c2789f4894.jpg[/img])'], 'type': 102}
- 以下算法的时间复杂度是( )for(i=0; i<; N; i++)for(j=0; j<;M; j++)for(k=0; k<;L; k++)x= x + k; 未知类型:{'options': ['O([img=17x19]17e43b025ee391a.jpg[/img])', ' O([img=19x18]17e43b0266fff04.jpg[/img])', ' O([img=15x17]17e43b026f6e6f5.jpg[/img])', ' O(N×M×L)'], 'type': 102}