Skip to content

OccupyMars2025/Introduction-to-Algorithms-4th-Edition

Repository files navigation

If you don't understand sth, that's okay. What you need to do is to read a lot of material(I mean a few hundred pages) and complete all the exercises on your own. But remember to start with material that fits your ability level. Yes, that's how we get things done. Very simple ! So easy !

So tell me, what are you eager to know ?

I am very interested in how to use programming to solve various real-world problems.

Great ! Then allow me to introduce you to the best introductory material: Introduction to Algorithms (Fourth Edition)

Excellent ! Let’s get to work !


Before reading the solution to a problem in the book, I like to challenge myself to try to solve it myself. So exciting !!!

You must implement all the algorithms on your own, complete all the exercises on your own, and prove and derive all the theorems on your own. Turn off Copilot and only turn to ChatGPT for some advice when you are stuck for at least 5 minutes. This method may seem slow, but it is actually the most efficient way to learn. Wow, that's so exciting ! Let's do it !


Learning Standards:

Phase 1: Choose any theorem or exercise from the textbook and be able to prove or solve it entirely on your own.

Phase 2: "What I cannot create, I do not understand." Rewrite the entire textbook from memory, without referring to the original text.


2023/1/9 18:00 - 1/12: round 1

2024/5/6 12:00 - 6/13: round 2

2024/9/6 21:00 - now: continue round 2, start from ch14: dynamic programming


"clrsPython" is copied from the official website


useful tools:

use networkx, graphviz to draw graphs


TODO: all the exercises and problems in ch1-ch11 in the 4th edition book, I have only completed them in ch1-ch11 in the 3rd edition book

Goal: 2024/5/6 12:00 - 5/25 22:00: complete learning this book

  • 2024/5/6 12:00 - 5/7 22:00 : Chapter 2 Getting Started
  • 5/7 22:00 - 5/8 22:10: Chapter 3: Characterizing Running Times, page 71-98
  • 5/8 22:10 - 5/12 19:30 : Chapter 4: Divide-and-Conquer, page 98-148

TODO: Section 4.6, 4.7 and Chapter 4 Problems

  • 5/12 19:30 - 5/17 8:30: Chapter 5: Probabilistic Analysis and Randomized Algorithms

TODO: page 151, chapter 5 Exercises

TODO: page 166-178

  • 5/17 8:30 - 5/18 15:40 : Chapter 6: Heapsort, page 178-204

TODO: all exercises and problems in Chapter 6

  • 5/18 15:40 - 5/20 19:00: Chapter 7: Quicksort, page 204-227

TODO: page 220-226

  • 5/20 19:00 - 5/23 8:30 : Chapter 8: Sorting in Linear Time, page 227-249

TODO: chapter 8: Problems

  • 5/23 8:30 - 5/25 10:30: Chapter 9: Medians and Order Statistics, page 249-270
  • 5/25 10:30 - 5/26 6:30: Chapter 10: Elementary Data Structures , page 270-294

TODO: chapter 9

TODO: Exercise 10.2-8

TODO: chapter 11.2 - 11.5

TODO: page 289-293

  • 5/26 6:30 - 5/28 12:10: Chapter 11: Hash Tables, page 294-334
  • 5/28 12:10 - 6/6 20:00: Chapter 12: Binary Search Trees, page 334-353

TODO: From Chapter 12 on, do exercises and problems using AI. You need to redo all the exercises and problems in Chapter 1-11 by the help of AI

  • 6/6 20:00 - 6/13 20:00 : Chapter 13: Red-Black Trees, page 353-382

TODO: Exercise 13.4-9, Problems in chapter 13

  • 9/6 21:20 - : Chapter 14: Dynamic Programming, page 362-417
    • 9/6 21:20 - 10/29 11:30: Section 14.1, 14.2, 14.3
    • 10/29 11:30 - 11/7 20:04: Section 14.4 Longest common subsequence

TODO: Exercise 14.4-6

  • 11/7 20:04 - : Section 14.5 Optimal binary search trees

How to study "algorithms" ? Recommend some textbooks and learning resources

Studying algorithms is essential for understanding problem-solving techniques, data processing, and optimizing code. Here’s a study approach with recommended resources to build your skills in algorithms:

Approach

  1. Start with Basics: Understand basic concepts, including data structures (arrays, linked lists, stacks, queues, trees, graphs) and algorithmic fundamentals (sorting, searching, recursion).
  2. Master Algorithm Analysis: Learn about time and space complexity using Big O notation, which helps in evaluating algorithm efficiency.
  3. Practice Core Algorithms: Focus on common algorithms such as sorting, searching, dynamic programming, and graph algorithms.
  4. Practice Problem-Solving: Regularly practice coding problems to internalize techniques and improve your speed and accuracy.
  5. Explore Advanced Topics: Study advanced topics like NP-completeness, advanced graph algorithms, and optimization techniques.

Recommended Textbooks

  1. "Introduction to Algorithms" by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (CLRS) – Often called the "CLRS book," this comprehensive textbook covers a wide range of algorithms with in-depth explanations and mathematical rigor.
  2. "Algorithms" by Robert Sedgewick and Kevin Wayne – A practical book that includes examples in Java, with a focus on problem-solving techniques and efficient coding.
  3. "The Algorithm Design Manual" by Steven S. Skiena – Known for its practical approach, this book is highly readable and includes real-world examples along with a "war story" section for each topic.
  4. "Grokking Algorithms" by Aditya Bhargava – A visually-oriented, beginner-friendly book that introduces algorithm concepts with engaging diagrams and examples.
  5. "Algorithms Illuminated" by Tim Roughgarden – This series provides clear, step-by-step explanations of algorithms and is available in multiple volumes, each covering different topics.

Additional Learning Resources

  • Online Courses:

    • Coursera: "Algorithms Specialization" by Stanford (Tim Roughgarden) – An accessible course that covers algorithms in depth.
    • MIT OpenCourseWare: "Introduction to Algorithms" – Based on MIT’s introductory algorithms class, this free course includes lecture videos, assignments, and exams.
    • Udacity’s "Data Structures and Algorithms" Nanodegree – Offers hands-on practice with a focus on preparing for technical interviews.
  • Practice Platforms:

    • LeetCode, HackerRank, and CodeSignal – Great platforms for practicing algorithm problems, especially if you’re preparing for coding interviews.
    • Project Euler – Offers math-based problems that require algorithmic thinking, perfect for building problem-solving skills.

Using these resources to develop both your theoretical understanding and practical coding skills will create a strong foundation in algorithms. Regular practice and challenging yourself with increasingly complex problems will solidify your knowledge over time.


Time is Money, Efficiency is Life

Algorithms as a Technology

"We hope that this textbook provides you with an enjoyable introduction to the field of algorithms. We have attempted to make every algorithm accessible and interesting. Enjoy it !"

"CLRS" (Cormen, Leiserson, Rivest, Stein)

reference:

https://github.com/walkccc/CLRS
https://walkccc.me/CLRS/
https://sites.math.rutgers.edu/~ajl213/CLRS/CLRS.html
https://github.com/walkccc/CLRS-cpp

tools:

install all the latest LLVM toolchain: https://apt.llvm.org/

About

Time is Money, Efficiency is Life

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published