What is the running time of two sorting algorithms if one is merge sort and one is insertion sort -
What is the running time of two sorting algorithms if one is merge sort and one is insertion sort -
if have sort 1 list , merge sorted one. running time if utilize merge sort , insertion sort? merge sort is: n logn insertion sort is: n^2 are?
edit: oh, meant had sort 1 of lists , merge them together. have made pseudocode insertion sort, don't know running time of 2 algorithms be. http://gyazo.com/0010f053f0fe64a82dad1dd383740a3f
the complexity of merging 2 sorted lists lengths n1 , n2 o(n1 + n2); should plenty work out big-oh of entire algorithm
algorithm sorting pseudocode mergesort
Comments
Post a Comment