- Published on
My Journey in Data Structures, Algorithms, and LeetCode (Part I)
- Authors
- Name
- Huan Zhang
- @zhkrob
Introduction
My journey with data structures, algorithms, and competitive programming started quite early and took several interesting turns over the years. Reflecting on these experiences helps me appreciate the growth and changes in my approach and passion.
Early Days and NOIP
My journey began around 2009, during secondary school. Our school organized a science festival requiring every student to pick a project. I chose the National Olympiad in Informatics in Provinces (NOIP), Basic Division. At the time, I had never studied data structures or algorithms. My first exposure came through a C programming textbook written by Haoqiang Tan, a prominent educator. Looking back ten years later, I realized the book was quite outdated and unprofessional by modern standards.
Fortunately, my father, who majored in computer science, quickly guided me through the basics. I still vividly remember him teaching me fundamental C syntax using a whiteboard. In my third year of secondary school, I participated in NOIP Basic Division, achieving a high score in the first round, thus qualifying for the finals in a bigger city three hours away. Despite minimal preparation, I managed a small prize in the second round—a hands-on competition where we needed to solve four problems within a limited time. Due to my lack of practice, even handling file input/output posed challenges.
Advanced Division and High School
During the summer after secondary school graduation, my father connected me with an IT teacher from my future high school. I joined an intensive training camp aimed at the NOIP Advanced Division. Winning first prize in this competition meant direct admission to top universities. This training exposed me to talented peers—many of whom later entered prestigious universities globally and excelled in the computer science industry. I learned advanced algorithms, including graph theory and dynamic programming, and dedicated at least one hour daily to practice.
After three months, I took the NOIP Advanced Division exam, performing exceptionally well in the first round despite the test's high difficulty. Although my score was under 40 out of 100, it ranked first in my city. However, similar to my previous experience, I did not perform as well in the second round. This setback led me to doubt my talent in competitive programming. Coupled with academic pressure from other subjects, I decided to abandon competitive programming—a decision I occasionally regret, especially seeing classmates who succeeded later.
University and Rediscovering Programming
Initially, I chose Mechanical Engineering in university due to concerns about prolonged computer use causing neck strain—a reason that now seems amusing yet valid. Although I excelled in programming-related courses like C++, embedded systems, and MATLAB, I did not actively pursue competitive programming opportunities such as ACM-ICPC, which remains another regret.
Postgraduate Studies and Return to CS
During my postgraduate studies at HKUST, my focus shifted to advanced topics like 3D printing, particularly 5-axis printing. I wrote numerous MATLAB scripts and notably produced a support-free Red Bird Sundial model—mirroring the sculpture at HKUST's entrance.
After graduation, aiming for a Ph.D. under Professor Kai Tang but lacking funding, I joined HKUST's Department of Computer Science and Engineering as a research assistant under Professors Chi-Keung Tang, Robin Ma, and Matthew Ming-Fai Yuen. My work revolved around building a fascinating 3D garment fitting system, extensively using C++ and OpenGL. My primary role involved geometric algorithm research rather than pure software development.
Discovering LeetCode
In 2019, while seeking to enhance my computer science fundamentals, I discovered LeetCode. Like many others, I found my first problem—"Two Sum"—challenging but rewarding. Solving it reignited my interest in data structures and algorithms after nearly a decade-long hiatus. This marked a turning point, and I realized my passion for algorithmic problem-solving had never fully disappeared.