CS 180, Algorithms and Complexity, is one of the most important courses you’ll take as a computer science major at UCLA. The algorithms you’ll learn are not only the foundation for many other courses you’ll take later on, but also essential pieces of knowledge for many common technical interview questions. You will learn some general classifications of algorithms (greedy, dynamic programming, maxflow, and more) and see plenty of variations of problems on each topic. Ultimately, the goal is to leave the course able to recognize patterns in problems and build intuition on how to solve them. Here are 6 tips to help you succeed in the class.
‍1. Attend lectures
This should be a given, but it can always be tempting to skip class. I strongly advise against skipping class lectures. The example problems discussed there are not only super helpful in terms of understanding the current topic, but also will likely come up in a similar (or identical!) fashion in homework and exams.
‍2. Get used to writing thorough mathematical proofs.
This class does not involve any coding. Instead, homework assignments are written mathematical proofs with complexity analysis and justification. Some problems come from the textbook, and others are “creative problems” which are the types of problems you’d encounter during the technical interview.Â
A big key to succeeding on these problems is to always write your best guess down, even if you aren’t 100% sure it's correct. You can receive some for completion. Don’t be tempted to google the answers because when the exams roll around you will be very unprepared. Professor Sarrafzadeh encourages learning over grades, which is why he heavily stresses always proving your algorithm and explaining its complexity to show you truly understand the topic.
‍3. Check out GeeksForGeeks.
‍GeeksForGeeks is a website that provides resources for learning about tech-related topics. Their website contains some of the creative problems discussed in class and other very similar ones. It also features pages dedicated to many common algorithms, describing and stepping through them and explaining their runtimes. Make sure to look for any topics you need clarification on.
‍4. Attend your discussion section.
TAs in CS 180 are crucial to your success. At discussion sessions, your TA will review the material from the week and provide guidance on starting your homework problems. The problems can often be tough to start, as they may be abstractions of similar problems and concepts from lectures. It depends on the TA, but most will be happy to give clues on how to begin formulating a solution to your problems.
‍5. Pay attention to your homework problems.
Exams consist of problems similar to the ones you’ve already encountered on the homework. Each exam will include a problem or two for each relevant topic. To do well, it's essential that you truly understand the differences between all the common algorithm types and strategies. Study until you feel confident walking through common algorithms (like Dijkstra’s and BFS/DFS) step-by-step, proving them, and explaining their runtimes.Â
The more practice problems you do for each type of algorithm, the better off you’ll be during the exam. Take the time to practice — even going through the tediousness of proving and analyzing your algorithm’s complexity each time. If you get to a place where you can recognize a problem’s type quickly, you’ll be able to devise a much more efficient strategy.
‍6. Remember that the material you learn in this course will come in handy well into the future.
My final tip is to make sure you put in the time to fully understand the course material. For this class, more than most, it is crucial to pay attention, study, and go over the material until you truly understand it — not just for your grade but for your future in CS. Algorithms are central to just about anything you’ll ever do, so I strongly recommend doing lots of review and truly cementing your understanding of these topics. It will serve you for many years to come.
Looking to crush your CS courses? Edlyft is here to help. Sign up here to stay up to date on all things Edlyft.