06 Time complexity of algorithm
linear time complexity
O(n^3)+O(n^2*logn) =O(n^3)
O(logN)
Unable to determine, it is related to the amount of input data, use the average complexity:
Worst/average time complexity
07 Space complexity of algorithm
S(n)=n
S(n)=O(n^2)
Brush questions:
O(n^3)
Answer:
BDCBB
Looking at the depth of recursion, the worst case scenario for merging two linked lists requires comparing every element in the longer linked list.