I do not come from a formal CS background, so I've mostly studied algorithms on my own. I've been stepping through Google's section of leetcode problems, and am wondering if there are a classic set of DP,BFS,DFS,tree (I haven't spent too much time with tree problems, but mostly I find it hard to visualize/come up with the recursive solutions on my own , ie something like find the diameter of a tree)/graph problems that I should understand before tackling leetcode? I am (somewhat) learning when to utilize BFS/DFS/dp as I do problems, but at this point if I haven't seen the problem, sometimes it is hard to complete 100% on my own. NOTE: I have read through CtCI
You need someone good to explain it to you. It does get better as time goes on.
Takes time. Look at the solution and write it out yourself. Use debugger to go over each line and understand why and how the solution works. Overtime after say 100 problems or so you will start to see patterns (I.e reuse code or logic you saw in previous problems)
For most people It will take time before you get good at solving medium and hard problems. Keep practicing, focus on improving your thought process and you will do great in a few months.