nathanwailes

Basic algorithms/techniques to rehearse daily

Mar 28th, 2024 (edited)
762
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. I have this page set up to help me randomize the basic algorithms/techniques as I practice them to help me avoid relying on cues from previous algorithms to jump-start my memory.
  2.  
  3. 1. Paste the list below into the list randomizer here: https://www.random.org/lists/
  4. 2. And then try to write them out from memory here: https://www.online-python.com/
  5. - I write the input data and function call first, then I write the function.
  6. - If you don't know or can't remember how to write out the algorithm, check the pastebin link for that algorithm to see the answer.
  7.  
  8. How to study this list without spending too much time every day:
  9. 1. If you haven't learned all of these yet, learn at most one new one per day.
  10. 2. When you randomize the list for review, only select the items you've already learned, and only review two per day. This should still give you enough practice with each one to keep it memorized, assuming you're doing this review every day.
  11. 3. [TODO: See if this works] Before trying to memorize the sorting algorithms, first pack ~5-10 numbered cards in your backpack and practice performing the sort manually for a few days.
  12.  
  13. Two Pointers - Two Sum - https://pastebin.com/B1qu06J1
  14. Two Pointers - Valid Palindrome
  15. Sliding Window - Max subarray of size K - https://pastebin.com/vrCdZTku
  16. Sliding Window - Best time to buy and sell stock
  17. Stack - Valid Parentheses
  18. BFS-R - Breadth-first search (recursive) - https://pastebin.com/emt7N5r5
  19. BFS-I - Breadth-first search (iterative) - https://pastebin.com/GcduujfA
  20. DFS-R - Depth-first search (recursive) - https://pastebin.com/CwH8Jez4
  21. DFS-I - Depth-first search (iterative) - https://pastebin.com/kJ9QbZhi
  22. BS-R - Binary search (recursive) - https://pastebin.com/Gkrg4Fy6
  23. BS-I - Binary search (iterative) - https://pastebin.com/PUa5aYLR
  24. DP - Dynamic programming - https://pastebin.com/TYcGDrwc
  25. DAC - Divide and conquer - https://pastebin.com/78dCMR1V
  26. BT - Backtracking - https://pastebin.com/yfNWUpmh
  27. Binary tree - Check if two trees are the same - https://pastebin.com/pvEtvTJg
  28. Binary tree - Invert it - https://pastebin.com/5ii5MSDK
  29. Linked List - Get the middle node - https://pastebin.com/TvMwzHeR
  30. Linked List - Reverse the list - https://pastebin.com/qFTYp63y
  31. Linked List - Merge two sorted lists - https://pastebin.com/t7fXaX1a
  32.  
  33. Low-priority:
  34. Dijkstra's algorithm - https://pastebin.com/Mzewnmby
  35. A* - https://pastebin.com/yi1aLrPm
  36. Topological sort - https://pastebin.com/0M8zwhqW
  37. Partition algorithm - https://pastebin.com/mvqCednj
  38. QuickSort - https://pastebin.com/x02GMp0d
  39. Bubble sort - https://pastebin.com/2Ugmw439
  40. Selection sort - https://pastebin.com/wSkJABDJ
  41. Insertion sort - https://pastebin.com/0TXwGFpQ
  42. Merge sort - https://pastebin.com/bpp8kais
  43. Heap sort - https://pastebin.com/X1JaNb6C
  44. Radix sort - https://pastebin.com/Yx4enQwb
  45. QuickSelect - https://pastebin.com/ctGLERH3
  46.  
Advertisement
Add Comment
Please, Sign In to add comment