数据结构里的算法复杂程度怎么计算,如题There is an algorithm with inserting an item to a ordered SeqList(顺序链表) and still keeping the SeqList ordered.The computational efficiency of this inserting algorithm is ( ).A.O(log2n)

来源:学生作业帮助网 编辑:作业帮 时间:2024/08/14 12:44:12
数据结构里的算法复杂程度怎么计算,如题There is an algorithm with inserting an item to a ordered SeqList(顺序链表) and still keeping the SeqList ordered.The computational efficiency of this inserting algorithm is ( ).A.O(log2n)
xRN@liJciB˴c;(RH!.D<ԯit/8-vgǹ܇bdX+a*[;u`Kce.7%>wD-P ZA71-߀LI!aJ@uPA7sm-*ğ45Ś{wxV%〪D8h)1@Vޝ-A i"*clAL} )bz,q(}Q!:stָOecw%YMu6qgNd+$I "$G:"[J2dBL

数据结构里的算法复杂程度怎么计算,如题There is an algorithm with inserting an item to a ordered SeqList(顺序链表) and still keeping the SeqList ordered.The computational efficiency of this inserting algorithm is ( ).A.O(log2n)
数据结构里的算法复杂程度怎么计算,如题
There is an algorithm with inserting an item to a ordered SeqList(顺序链表) and still keeping the SeqList ordered.The computational efficiency of this inserting algorithm is ( ).
A.O(log2n) B.O(1)
C.O(n) D.O(n2)

数据结构里的算法复杂程度怎么计算,如题There is an algorithm with inserting an item to a ordered SeqList(顺序链表) and still keeping the SeqList ordered.The computational efficiency of this inserting algorithm is ( ).A.O(log2n)
C 链表的插入 不管是否有序都是从头遍历,所以
每个节点的概率是1/n
1/n(1+2+...+n)=(n+1)/2
所以是o(n)