Volume 2: Level Up Your Core Programming Skills
Jay Wengrow

#Python
#Algorithms
#Data_Structures
🚀 ساختارهای داده و الگوریتمهای پیشرفته در Python
⚡ میخوای کدی بنویسی که مرزهای سرعت، صرفهجویی در حافظه و Scalability رو جابهجا کنه؟ پس به Data Structureها و Algorithmهای پیشرفتهتری نیاز داری. در این کتاب از Big O Notation فراتر میری و یاد میگیری کارایی واقعی هر Algorithmی رو که طراحی میکنی، دقیقتر ارزیابی کنی.
🧩 با Data Structureهایی مثل B-tree، Bit Vector و Bloom Filter سراغ Big Data میری و با تکنیکهایی مثل Caching، Randomization و Fingerprinting حتی اپلیکیشنهای بسیار سنگین رو هم کنترل میکنی.
📘 کتاب با زبان ساده، Diagramهای واضح، تمرینهای عملی و Solutionهای کامل، این موضوعهای پیشرفته رو قابلفهم میکنه. از مباحث پایه عبور میکنی و با مفاهیم سطح بالاتر، نرمافزاری میسازی که برای چالشهای واقعی آماده باشه.
🧠 اپلیکیشنهایی که امروز مینویسی هر روز پیچیدهتر میشن، بنابراین دانش و تکنیکهای تو هم باید همراه اونها رشد کنن. تسلط روی Data Structureها و Algorithmها کمکت میکنه نرمافزار رو سریعتر توسعه بدی؛ نرمافزاری که درست کار میکنه، پرفورمنس خوبی داره و بهخوبی Scale میشه.
📚 جلد دوم این مجموعه، دانش تو درباره Data Structureها و Algorithmها رو به سطح بالاتری میبره. با این راهنمای عملی و قابلفهم، یاد میگیری نرمافزاری بسازی که بتونه مستقیما با مسئلههای پیچیده امروزی روبهرو بشه. نسخه Python کتاب هم برای تمام مثالهای کد، تمرینها و Solutionها منحصرا از Python استفاده میکنه.
⏱️ کد Python خودت رو Benchmark میکنی تا سرعت واقعی اون رو بفهمی. با ترکیب Data Structureهای مختلف، Solutionهای سریع و در عین حال تمیز و Elegant طراحی میکنی.
🎲 از Monte Carlo Algorithmها استفاده میکنی تا بهشکلهای جالبی محدودیتهای سرعت و مصرف Memory اپلیکیشن رو جابهجا کنی. Big Data رو با B-treeها و Algorithmهای تخصصی دیگه مدیریت میکنی و با اضافه کردن هوشمندانه کمی Randomization، Algorithmهای کارآمدتری طراحی میکنی.
💾 حجم زیادی از داده رو داخل Bit Vectorها و Bloom Filterهای بسیار کمحجم جا میدی و از Caching استفاده میکنی تا پرفورمنس نرمافزارت بهشکل چشمگیری افزایش پیدا کنه.
🎯 با یادگیری این تکنیکهای پیشرفته، میتونی نرمافزارهایی بسازی که واقعا از پس چالشهای امروزی برمیان.
🛠️ چیزهایی که نیاز داری
🐍 برای بررسی و اجرای کدهای کتاب، فقط به Text Editor دلخواهت و محیطی نیاز داری که بتونه Python 3 اجرا کنه.
📌 برای درک این جلد لازم نیست حتما جلد اول کتاب رو خونده باشی، اما باید با مفاهیمی که در جلد اول مطرح شدهاند آشنایی داشته باشی.
📖 فهرست مطالب
فصل ۱. مرتبسازی با Mergesort
فصل ۲. Benchmark کردن کد
فصل ۳. واقعا چقدر تصادفیه؟
فصل ۴. Cache پادشاهه
فصل ۵. هنر بزرگ متعادلسازی در Red-Black Treeها
فصل ۶. Treapهای Randomized. رسیدن تصادفی به تعادل
فصل ۷. B-Tree یا نه؟ Algorithmهای External-Memory
فصل ۸. مدیریت Big Data با M/B-Way Mergesort
فصل ۹. حساب کردن روی Monte Carlo Algorithmها
فصل ۱۰. طراحی Hash Tableهای عالی با Randomization
فصل ۱۱. جستوجوی دقیق متن با کمی Rabin-Karp
فصل ۱۲. صرفهجویی در فضا. هر Bit اهمیت داره
فصل ۱۳. افزایش بهرهوری با Bloom Filterها
📝 نقد و بررسی
💭 «جلد دوم این مجموعه یک ادامه جامع برای همون رویکرد جذاب و سادهایه که این موضوع پیچیده واقعا بهش نیاز داشت. اگر مشتاقی بیشتر یاد بگیری و عمیقتر بفهمی Algorithmها و Data Structureهایی که هر روز استفاده میکنیم واقعا چطور کار میکنن، این کتاب برای توئه!»
— مایکل پابن، Software Engineer در Discord
💭 «Jay دوباره موفق شده. جلد دوم A Common-Sense Guide to Data Structures and Algorithms in Python بهاندازه جلد اول عالیه؛ و جلد اول واقعا فوقالعاده بود. بدون شک این دو کتاب منابعی هستن که هر کسی در این حوزه باید داشته باشه.»
— لیندون پرسل، Software Developer در OK200 Software & Apps
💭 «نویسندهها اغلب از همون ابتدا با انبوه جزئیات و اثباتهای ریاضی، خواننده رو از دست میدن. اما این کتاب یک رویکرد آموزشی متفاوت رو انتخاب میکنه. ابتدا با Illustrationهای هوشمندانه که یکی از ویژگیهای اصلی کار Jay هستن، مفهوم کلی یک Algorithm یا Data Structure به خواننده معرفی میشه.
بعد از اینکه خواننده بهاندازه کافی آماده شد، Jay وارد جزئیات پیچیده و Edge Caseها میشه و زمینه رو برای پیادهسازی کد فراهم میکنه. این رویکرد در سراسر کتاب عالی عمل میکنه، بهخصوص در فصل Red-Black Treeها که واقعا یک شاهکاره و نشون میده چطور میشه یک موضوع پیچیده رو با شفافیت و تاثیرگذاری آموزش داد.»
— احمد شهبا، Lead Software Engineer در Science Systems and Applications, Inc.
💭 «بهعنوان یک دولوپر خودآموخته، طرفدار خیلی بزرگ این کتابم. یک موضوع واقعا پیچیده رو به چیزی تبدیل میکنه که هم راحت میشه فهمیدش و هم یاد گرفتنش لذتبخشه.»
— فیوهان شاناهان-دوور، Software Developer
💭 «Jay خودش رو بهعنوان یک مدرس و نویسنده عالی متمایز میکنه؛ چون موضوعی نسبتا پیچیده و سختفهم رو که برای هر متخصص توسعه نرمافزار ضروریه، بسیار قابلدسترس و لذتبخش میکنه، بدون اینکه از عمق مطلب کم کنه.»
— پا جیک، Test Engineer در tech11
💭 «این کتاب مفاهیم پیچیده Data Structureها رو بهشکل خیلی ساده و قابلفهم توضیح میده. موقع خوندنش بارها لحظههای "آها، پس اینطوریه!" رو تجربه میکنی.»
— پراوین کومار، Software Engineer در Cigna
👤 درباره نویسنده
👨💻 جی ونگرو مدرس و Software Engineer باتجربهایه. او بنیانگذار Actualize، یکی از Coding Bootcampهای برنده جایزه در آمریکاست که به صدها نفر با پیشزمینههای مختلف کمک کرده مسیر حرفهای خودشون رو بهعنوان Software Engineer شروع کنن.
🧩 او علاقه زیادی به قابلدسترستر کردن Software Development داره و این کار رو با شکستن مفاهیم پیچیده به بخشهای سادهتر، کوچکتر و قابلفهمتر انجام میده.
Want to write code that pushes the boundaries of speed, space savings, and scalability? Then you need more advanced data structures and algorithms. Go beyond Big O notation and evaluate the true efficiency of each algorithm you design. Pull out data structures such as B-trees, bit vectors, and Bloom filters to wrangle big data. Wield techniques like caching, randomization, and fingerprinting to tame even the most demanding applications. With simple language, clear diagrams, and practice exercises and solutions, this book makes these topics easy to grasp. Go beyond the basics and use these next-level concepts to build software that's ready to take on the challenges of the real world.
The applications you write get more complex by the day. To keep up, you need to ensure your knowledge and techniques grow, too. A mastery of data structures and algorithms lets you write software more quickly; software that works, performs, and scales. Volume 2 of the series takes your knowledge of data structures and algorithms to the next level. With this practical and easy-to-understand guide, you'll create software that can tackle today's challenging problems head on. This Python edition uses Python exclusively for all code examples, exercises, and solutions.
Benchmark your Python code to learn its true speed. Design fast and elegant solutions by connecting different data structures together. Use Monte Carlo algorithms to push the limits of your application's speed and memory savings in surprising ways. Wrangle big data with B-trees and other specialized algorithms. Design efficient algorithms by cleverly sprinkling in a bit of randomization. Cram tons of data into tiny bit vectors and Bloom filters. And leverage caching to make your software blazingly fast.
Learn these sophisticated techniques and create great software that meets today's challenges.
What You Need:
To explore and execute the book's code, you'll need your favorite text editor and an environment that can run Python 3. While you needn't have read Volume 1 of this book to understand the current volume, you do need to be familiar with the concepts discussed there.
Table of Contents
Chapter 1. Getting Things in Order with Mergesort
Chapter 2. Benchmarking Code
Chapter 3. How Random Is That?
Chapter 4. Cache Is King
Chapter 5. The Great Balancing Act of Red-Black Trees
Chapter 6. Randomized Treaps: Haphazardly Achieving Equilibrium
Chapter 7. To B-Tree or Not to B-Tree: External-Memory Algorithms
Chapter 8. Wrangling Big Data with M/B-Way Mergesort
Chapter 9. Counting on Monte Carlo Algorithms
Chapter 10. Designing Great Hash Tables with Randomization
Chapter 11. Keeping Your Text Search Sharp with a Little Rabin-Karp
Chapter 12. Saving Space: Every Bit Helps
Chapter 13. Cultivating Efficiency with Bloom Filters
Early Praise for A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 2
“Volume 2 in this series is a comprehensive extension to the exciting common-sense approach that this notorious topic needed. If you’re eager to learn more and dig deeper into how the algorithms and data structures we use daily actually work, this is the book for you!”
➤ Michael Pabon
Software Engineer, Discord
“Jay has done it again. The second volume of A Common-Sense Guide to Data Structures and Algorithms in Python is every bit as good as the first (which was awesome). These are, without a doubt, the two books on the topic everyone should own.”
➤ Lyndon Purcell
Software Developer, OK200 Software & Apps
“Authors often lose their readers by overwhelming them from the outset with details and mathematical proofs. In contrast, this book adopts an alternative pedagogical approach. Readers are first introduced to the gist of an algorithm or data structure using cleverly designed illustrations, a hallmark of Jay’s work. Once the reader is adequately prepared, Jay discloses the intricate details and edge cases, laying the grounds for code implementation. This approach shines throughout the book, particularly in the chapter on red-black trees, which is a masterpiece, demonstrating how a complex subject can be taught with clarity and effectiveness.”
➤ Ahmad Shahba
Lead Software Engineer, Science Systems and Applications, Inc.
“I am such a huge fan of this book as a self-taught developer. It takes a very tricky topic and makes it easy to understand and fun to learn.”
➤ Fiohann Shanahan-Dover
Software Developer
“Jay sets himself apart as an excellent teacher and author by making a rather complex and obtuse subject (one that is very much needed in a software creation professional’s arsenal) very approachable and enjoyable to study while still going deep.”
➤ Paa JAKE
Test Engineer, tech11
“This book explains complex data structure concepts in a very simple and approachable way. You’ll experience many ‘aha!’ moments when you read this book.”
➤ Praween Kumar
Software Engineer, Cigna
About the Author
Jay Wengrow is an experienced educator and software engineer. He is the founder of Actualize, an award-winning US coding bootcamp that has helped hundreds of people from all backgrounds launch their careers as software engineers. He is passionate about making software development more accessible by breaking the complex down into its simpler, easier parts.









