• 2022-07-28
    在已知头指针的单链表中,要在其尾部插入一新结点,其算法的时间复杂度为( )。
    未知类型:{'options': ['O(1)', ' O([img=34x18]17e436767faafc6.jpg[/img])', ' O(n)', ' O([img=16x18]17e436db6f18ee9.jpg[/img])'], 'type': 102}
  • C

    内容

    • 0

      在具有n个结点的有序单链表中插入一个新结点并仍然有序的时间复杂度是()。 未知类型:{'options': ['O(1)', ' O(n)', ' O([img=16x18]17e0a6d25e02f0a.jpg[/img])', ' O([img=45x18]17e0a8c6563443f.jpg[/img])'], 'type': 102}

    • 1

      下面程序段的时间复杂度。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}

    • 2

      下面代码段的时间复杂度是()。 未知类型:{'options': ['O(n)', ' O([img=16x18]17da57a0443d17d.jpg[/img])', ' O(1)', ' O([img=34x18]17da57a04e0132c.jpg[/img])'], 'type': 102}

    • 3

      在已知头指针的单链表中,要在其尾部插入一新结点,其算法所需的时间复杂度为( )。 A: O(1) B: O(log2n) C: O(n) D: O(n2)

    • 4

      求以下算法的时间复杂度。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}