Just keep going.
Mood swings occur in any field. If you like the task of coding, problem solving and researching you are fine.
Everybody needs to look up stuff. The human brain was made to find patterns and think, not to store information indefinitely. For this we have made computers.
Try not to learn something by heart. But to hone your skills in doing/processing/solving things.
Looking at code and understanding it is much more appreciated than knowing specific algorithms.
Sure patterns are helpful and are actually necessary to be known. But those will come with time.