Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Evaluation the runtime of merge sort.
  2. https://teamtreehouse.com/library/evaluating-the-runtime-of-merge-sort
  3.  
  4. in Python a recursive and an iterative version.
  5.  
  6. 3:28
  7. In the recursive one we use list slicing with every recursion call, but we achieve
  8.  
  9. 3:33
  10. the same end result using an iterative approach without using list slicing.
  11.  
  12. 3:37
  13. Over there we declared two variables to keep track of the starting, and
  14.  
  15. 3:42
  16. ending positions in the list.
  17.  
  18. 3:44
  19. We could rewrite merge sort to do the same, but
  20.  
  21. 3:47
  22. I'll leave that as an exercise for you.
  23.  
  24. 3:49
  25. If you want some hints, or
  26.  
  27. 3:51
  28. if you want any direction I've included a link in the notes with an implementation.
  29.  
  30. 3:55
  31. So that is time complexity.
  32.  
  33. 3:58
  34. Now just so we know, before moving on, for
  35.  
  36. 4:01
  37. Python here our overall run time is not what I've listed here.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement