Advertisement
Guest User

notes

a guest
Jul 17th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1.  
  2. O(n^2) [Quadratic] sorting algorithms:
  3. -Selection sort:
  4. >finds optimal value, swaps it to sorted section
  5.  
  6. -Insertion sort:
  7. >traverses the data, checks if sorted, if not, retreats along data shifting along the way to find sorted spot
  8.  
  9. O(n log n) [linear-logarithmic] sorting algorithms:
  10. -Merge sort:
  11. >splits the list in two, sorts them, then merges them in correct order
  12. -Quick sort:
  13. >uses a pivot, usually the median of the data,
  14. -Heap sort:
  15. O(n) [linear] sorting algorithm:
  16. -Radix sort:
  17. >Dropping values into "buckets" based on their chars/integers. Its worst case is always O(n).
  18. >Efficiency will be m*n, where m is the number of digits/characters, or the amount of rounds to drop data into the "buckets", and n is the number of data values.
  19.  
  20. Comparison-based sort is always no better than O(n log(n)) (linear-logarithmic)
  21.  
  22. =week 10 notes=
  23.  
  24. Queues:
  25. -FIFO: item added first or earliest is at the front and will be removed first. Most recent added will be removed last.
  26. -Additions to software queues must be done at the back/rear.
  27. -The client can only look at or remove the data at the front.
  28. -enque (adding to the back/rear of queue)
  29. -dequeue (removing from the front of a queue)
  30.  
  31. Deque:
  32. -add and remove from both sides
  33. -doubly linked chain
  34.  
  35. Sorted vs. unsorted procedures:
  36. -unsorted vs sorted inserting/adding:
  37. >unsorted inserting is O(1)
  38. >sorted inserting is O(n)
  39. -delete minimum/maximum:
  40. >sorted delete minimum: O(1)
  41. >unsorted delete minimum: O(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement