This commit is contained in:
krahets
2026-11-04 01:07:29 +08:00
parent b1daaffc33
commit 1bbfde55c8
293 changed files with 2446 additions and 3262 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -131,108 +131,113 @@
</nav>
</header>
<div class="md-container" data-md-component="container">
<section class="home-div" data-md-color-primary="grey" data-md-color-scheme="slate" style="height: min(100vh, 120vw); position: relative; margin-top:-2.4rem; padding: 0; overflow: hidden;" id="__skip" tabindex="-1">
<link href="../assets/home/ad8bb1cc4c28091c/hero-motion.css" rel="stylesheet"/>
<noscript>
<style>
[data-home-src], video[data-home-poster] { display: none; }
</style>
</noscript>
<section class="home-div home-universe-bg" data-md-color-primary="grey" data-md-color-scheme="slate" id="__skip" tabindex="-1">
<div class="starfield">
<div class="starfield-origin">
</div>
</div>
<div class="hero-div hero-div--ru">
<img alt="" src="../assets/hero/ground.png" style="position: absolute; width: auto; height: 26.445%; left: 28.211%; top: 54.145%;"/>
<img alt="" src="../assets/hero/links.png" style="position: absolute; width: auto; height: 78.751%; left: 10.545%; top: 7.326%;"/>
<div class="hero-div hero-div--ru" data-home-layout="list">
<img alt="" data-hero-asset="ground" data-source-height="380" data-source-width="881" height="380" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/567306c070a6a7e2/ground.webp" style="position: absolute; width: auto; height: 26.445%; left: 28.211%; top: 54.145%;" width="881"/>
<img alt="" data-hero-asset="links" data-source-height="1134" data-source-width="1562" height="1134" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/3e50f38a325c1cb5/links.webp" style="position: absolute; width: auto; height: 78.751%; left: 10.545%; top: 7.326%;" width="1562"/>
<a href="chapter_introduction/">
<img alt="" src="../assets/hero/astronaut.png" style="height: 46.673%; left: 35.413%; top: 24.343%;"/>
<img alt="" data-hero-asset="astronaut" data-source-height="672" data-source-width="515" height="672" src="../assets/home/ad8bb1cc4c28091c/../shared/images/8e5eb3b3e3ebd9f7/astronaut.webp" style="height: 46.673%; left: 35.413%; top: 24.343%;" width="515"/>
<span style="left: 49.244%; top: 22.2%;">
Первое знакомство с алгоритмами
</span>
</a>
<a href="chapter_computational_complexity/">
<img alt="" src="../assets/hero/chapter_computational_complexity.png" style="height: 12.347%; left: 36.267%; top: 37.653%;"/>
<img alt="" data-hero-asset="chapter_computational_complexity" data-source-height="178" data-source-width="113" height="178" src="../assets/home/ad8bb1cc4c28091c/../shared/images/2fb425426d1f8d86/chapter_computational_complexity.webp" style="height: 12.347%; left: 36.267%; top: 37.653%;" width="113"/>
<span style="left: 34.244%; top: 33.919%;">
Сложность
</span>
</a>
<a href="chapter_array_and_linkedlist/">
<img alt="" src="../assets/hero/chapter_array_and_linkedlist.png" style="height: 22.242%; left: 73.242%; top: 52.481%;"/>
<img alt="" data-hero-asset="chapter_array_and_linkedlist" data-source-height="319" data-source-width="468" height="319" src="../assets/home/ad8bb1cc4c28091c/../shared/images/5cbbdf7be555d3ef/chapter_array_and_linkedlist.webp" style="height: 22.242%; left: 73.242%; top: 52.481%;" width="468"/>
<span style="left: 83.897%; top: 76.259%;">
Массивы и списки
</span>
</a>
<a href="chapter_stack_and_queue/">
<img alt="" src="../assets/hero/chapter_stack_and_queue.png" style="height: 14.302%; left: 62.646%; top: 77.875%;"/>
<img alt="" data-hero-asset="chapter_stack_and_queue" data-source-height="204" data-source-width="204" height="204" src="../assets/home/ad8bb1cc4c28091c/../shared/images/e2667767cf7481bd/chapter_stack_and_queue.webp" style="height: 14.302%; left: 62.646%; top: 77.875%;" width="204"/>
<span style="left: 77.571%; top: 91.25%;">
Стеки и очереди
</span>
</a>
<a href="chapter_hashing/">
<img alt="" src="../assets/hero/chapter_hashing.png" style="height: 15.266%; left: 63.281%; top: 27.933%;"/>
<img alt="" data-hero-asset="chapter_hashing" data-source-height="218" data-source-width="218" height="218" src="../assets/home/ad8bb1cc4c28091c/../shared/images/b108d70a537714cb/chapter_hashing.webp" style="height: 15.266%; left: 63.281%; top: 27.933%;" width="218"/>
<span style="left: 68.862%; top: 46.292%;">
Хеш-таблицы
</span>
</a>
<a href="chapter_tree/">
<img alt="" src="../assets/hero/chapter_tree.png" style="height: 19.615%; left: 80.137%; top: 26.678%;"/>
<img alt="" data-hero-asset="chapter_tree" data-source-height="281" data-source-width="280" height="281" src="../assets/home/ad8bb1cc4c28091c/../shared/images/8138bb0acecedec4/chapter_tree.webp" style="height: 19.615%; left: 80.137%; top: 26.678%;" width="280"/>
<span style="left: 96.159%; top: 44.8%;">
Деревья
</span>
</a>
<a href="chapter_heap/">
<img alt="" src="../assets/hero/chapter_heap.png" style="height: 10.566%; left: 77.226%; top: 11.559%;"/>
<img alt="" data-hero-asset="chapter_heap" data-source-height="152" data-source-width="151" height="152" src="../assets/home/ad8bb1cc4c28091c/../shared/images/7586281e6691807a/chapter_heap.webp" style="height: 10.566%; left: 77.226%; top: 11.559%;" width="151"/>
<span style="left: 88.103%; top: 15.422%;">
Кучи
</span>
</a>
<a href="chapter_graph/">
<img alt="" src="../assets/hero/chapter_graph.png" style="height: 16.112%; left: 51.854%; top: 5.575%;"/>
<img alt="" data-hero-asset="chapter_graph" data-source-height="272" data-source-width="542" height="272" src="../assets/home/ad8bb1cc4c28091c/../shared/images/175a7f2e7c3cf5f0/chapter_graph.webp" style="height: 16.112%; left: 51.854%; top: 5.575%;" width="542"/>
<span style="left: 71.195%; top: 6.503%;">
Графы
</span>
</a>
<a href="chapter_searching/">
<img alt="" src="../assets/hero/chapter_searching.png" style="height: 15.149%; left: 18.185%; top: 16.404%;"/>
<img alt="" data-hero-asset="chapter_searching" data-source-height="216" data-source-width="216" height="216" src="../assets/home/ad8bb1cc4c28091c/../shared/images/ebfe2b953dbb9d90/chapter_searching.webp" style="height: 15.149%; left: 18.185%; top: 16.404%;" width="216"/>
<span style="left: 14.556%; top: 20.876%;">
Поиск
</span>
</a>
<a href="chapter_sorting/">
<img alt="" src="../assets/hero/chapter_sorting.png" style="height: 9.574%; left: 25.409%; top: 40.747%;"/>
<img alt="" data-hero-asset="chapter_sorting" data-source-height="137" data-source-width="138" height="137" src="../assets/home/ad8bb1cc4c28091c/../shared/images/9d4be68b2680967c/chapter_sorting.webp" style="height: 9.574%; left: 25.409%; top: 40.747%;" width="138"/>
<span style="left: 28.805%; top: 53.808%;">
Сортировка
</span>
</a>
<a href="chapter_divide_and_conquer/">
<img alt="" src="../assets/hero/chapter_divide_and_conquer.png" style="height: 18.681%; left: 32.721%; top: 4.816%;"/>
<img alt="" data-hero-asset="chapter_divide_and_conquer" data-source-height="269" data-source-width="407" height="269" src="../assets/home/ad8bb1cc4c28091c/../shared/images/6f5766ca9385cd2e/chapter_divide_and_conquer.webp" style="height: 18.681%; left: 32.721%; top: 4.816%;" width="407"/>
<span style="left: 28.42%; top: 8.679%;">
Разделяй и властвуй
</span>
</a>
<a href="chapter_backtracking/">
<img alt="" src="../assets/hero/chapter_backtracking.png" style="height: 17.338%; left: 4.875%; top: 32.925%;"/>
<img alt="" data-hero-asset="chapter_backtracking" data-source-height="249" data-source-width="345" height="249" src="../assets/home/ad8bb1cc4c28091c/../shared/images/176675e685febf11/chapter_backtracking.webp" style="height: 17.338%; left: 4.875%; top: 32.925%;" width="345"/>
<span style="left: 4.742%; top: 50.113%;">
Поиск с возвратом
</span>
</a>
<a href="chapter_dynamic_programming/">
<img alt="" src="../assets/hero/chapter_dynamic_programming.png" style="height: 15.47%; left: 9.406%; top: 57.472%;"/>
<img alt="" data-hero-asset="chapter_dynamic_programming" data-source-height="268" data-source-width="267" height="268" src="../assets/home/ad8bb1cc4c28091c/../shared/images/06264b1ffd05b08e/chapter_dynamic_programming.webp" style="height: 15.47%; left: 9.406%; top: 57.472%;" width="267"/>
<span style="left: 6.561%; top: 75.351%;">
Динамическое программирование
</span>
</a>
<a href="chapter_greedy/">
<img alt="" src="../assets/hero/chapter_greedy.png" style="height: 14.127%; left: 23.132%; top: 75.803%;"/>
<img alt="" data-hero-asset="chapter_greedy" data-source-height="202" data-source-width="265" height="202" src="../assets/home/ad8bb1cc4c28091c/../shared/images/2ce6caaac951c40b/chapter_greedy.webp" style="height: 14.127%; left: 23.132%; top: 75.803%;" width="265"/>
<span style="left: 20.619%; top: 86.85%;">
Жадные алгоритмы
</span>
</a>
</div>
<div class="heading-div">
<img alt="" src="https://readme-typing-svg.demolab.com/?font=Roboto&amp;weight=400&amp;duration=3500&amp;pause=2000&amp;color=FFF&amp;center=true&amp;vCenter=true&amp;random=false&amp;width=260&amp;lines=Hello%2C+%D0%90%D0%BB%D0%B3%D0%BE!" style="height: min(9vh, 12vw);"/>
<img alt="" loading="lazy" src="https://readme-typing-svg.demolab.com/?font=Roboto&amp;weight=400&amp;duration=3500&amp;pause=2000&amp;color=FFF&amp;center=true&amp;vCenter=true&amp;random=false&amp;width=260&amp;lines=Hello%2C+%D0%90%D0%BB%D0%B3%D0%BE!" style="height: min(9vh, 12vw);"/>
<div style="pointer-events: auto;">
<p style="margin-top: max(-1vh, -2vw); margin-bottom: min(2vh, 3.5vw);">
Учебник по структурам данных и алгоритмам с анимированными схемами и кодом, готовым к запуску в один клик
</p>
<a class="rounded-button" href="chapter_hello_algo/">
<svg viewbox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M160 96a96 96 0 1 1 192 0A96 96 0 1 1 160 96zm80 152V512l-48.4-24.2c-20.9-10.4-43.5-17-66.8-19.3l-96-9.6C12.5 457.2 0 443.5 0 427V224c0-17.7 14.3-32 32-32H62.3c63.6 0 125.6 19.6 177.7 56zm32 264V248c52.1-36.4 114.1-56 177.7-56H480c17.7 0 32 14.3 32 32V427c0 16.4-12.5 30.2-28.8 31.8l-96 9.6c-23.2 2.3-45.9 8.9-66.8 19.3L272 512z">
</path>
</svg>
@@ -265,7 +270,10 @@
<a href="chapter_hello_algo/">
<div style="height: 4.34%;">
</div>
<img alt="" class="device-on-hover" src="../assets/hero/web_mac_iphone.png" style="height: 66.31%;"/>
<img alt="" class="device-on-hover" data-home-src="../assets/home/ad8bb1cc4c28091c/../shared/images/5b64cf7672ec5ec6/web_mac_iphone.webp" decoding="async" height="965" style="height: 66.31%;" width="1598"/>
<noscript>
<img alt="" class="device-on-hover" height="965" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/5b64cf7672ec5ec6/web_mac_iphone.webp" style="height: 66.31%;" width="1598"/>
</noscript>
<div style="height: 4.34%;">
</div>
<div class="text-button">
@@ -281,7 +289,10 @@
</div>
<div class="media-block">
<a href="https://github.com/krahets/hello-algo/releases">
<img alt="" class="device-on-hover" src="../assets/hero/pdf_ipad.png" style="height: 75%;"/>
<img alt="" class="device-on-hover" data-home-src="../assets/home/ad8bb1cc4c28091c/../shared/images/66baa2f9bf3abec7/pdf_ipad.webp" decoding="async" height="960" style="height: 75%;" width="812"/>
<noscript>
<img alt="" class="device-on-hover" height="960" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/66baa2f9bf3abec7/pdf_ipad.webp" style="height: 75%;" width="812"/>
</noscript>
<div class="text-button">
<span>
Скачать PDF/EPUB
@@ -348,12 +359,24 @@
</p>
</div>
</div>
<video aria-label="Animation example" autoplay="" class="intro-image" loop="" muted="" playsinline="" src="index.assets/animation.mp4">
<video aria-label="Animation example" class="intro-image" data-home-poster="../assets/home/ad8bb1cc4c28091c/../shared/images/9e5f39bf33afc70f/animation-poster.webp" data-home-video="../assets/home/ad8bb1cc4c28091c/../shared/media/6c70de2b2bf4eef7/animation.mp4" height="1080" loop="" muted="" playsinline="" preload="none" style="aspect-ratio: 1600 / 1080" width="1600">
</video>
<noscript>
<a href="../assets/home/ad8bb1cc4c28091c/../shared/media/6c70de2b2bf4eef7/animation.mp4">
<img alt="Animation example" class="intro-image" height="1080" src="../assets/home/ad8bb1cc4c28091c/../shared/images/9e5f39bf33afc70f/animation-poster.webp" width="1600"/>
Анимированные схемы
</a>
</noscript>
</div>
<div class="intro-container">
<video aria-label="Running code example" autoplay="" class="intro-image" loop="" muted="" playsinline="" src="index.assets/running_code.mp4">
<video aria-label="Running code example" class="intro-image" data-home-poster="../assets/home/ad8bb1cc4c28091c/../shared/images/f33a13e8331245ae/running_code-poster.webp" data-home-video="../assets/home/ad8bb1cc4c28091c/../shared/media/bb169a96ca8316da/running_code.mp4" height="1082" loop="" muted="" playsinline="" preload="none" style="aspect-ratio: 1600 / 1082" width="1600">
</video>
<noscript>
<a href="../assets/home/ad8bb1cc4c28091c/../shared/media/bb169a96ca8316da/running_code.mp4">
<img alt="Running code example" class="intro-image" height="1082" src="../assets/home/ad8bb1cc4c28091c/../shared/images/f33a13e8331245ae/running_code-poster.webp" width="1600"/>
Запуск в один клик
</a>
</noscript>
<div class="intro-text">
<div>
<div style="display: flex; align-items: center;">
@@ -398,8 +421,14 @@
</p>
</div>
</div>
<video aria-label="Comments example" autoplay="" class="intro-image" loop="" muted="" playsinline="" src="index.assets/comment.mp4">
<video aria-label="Comments example" class="intro-image" data-home-poster="../assets/home/ad8bb1cc4c28091c/../shared/images/f9ac69536a7582f5/comment-poster.webp" data-home-video="../assets/home/ad8bb1cc4c28091c/../shared/media/62aa0b8d351c63a7/comment.mp4" height="1080" loop="" muted="" playsinline="" preload="none" style="aspect-ratio: 1600 / 1080" width="1600">
</video>
<noscript>
<a href="../assets/home/ad8bb1cc4c28091c/../shared/media/62aa0b8d351c63a7/comment.mp4">
<img alt="Comments example" class="intro-image" height="1080" src="../assets/home/ad8bb1cc4c28091c/../shared/images/f9ac69536a7582f5/comment-poster.webp" width="1600"/>
Учимся вместе
</a>
</noscript>
</div>
</div>
</section>
@@ -409,10 +438,10 @@
<h3>
Автор
</h3>
<div class="profile-div" style="gap: 1.25em; justify-content: center;">
<div class="profile-div">
<div class="profile-cell">
<a href="https://github.com/krahets">
<img alt="Author: yudongjin" class="profile-img" src="../assets/avatar/avatar_yudongjin.jpg"/>
<img alt="Author: yudongjin" class="profile-img" height="512" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/02348410d40f7665/avatar_yudongjin.webp" width="512"/>
<br/>
<b>
Yudong Jin (@krahets)
@@ -428,9 +457,9 @@
<p>
Русская печатная версия была переведена И. А. Шевкун, а русская онлайн-версия была вычитана Yuyan Huang. Благодарим их за вклад!
</p>
<div class="profile-div translator-profile-div">
<div class="profile-div">
<div class="profile-cell translator-profile-cell">
<img alt="Translator: shevkun" class="profile-img" src="../assets/avatar/avatar_shevkun.jpg"/>
<img alt="Translator: shevkun" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/91019a79d7ac4441/avatar_shevkun.webp" width="384"/>
<br/>
<b>
И. А. Шевкун
@@ -438,7 +467,7 @@
</div>
<div class="profile-cell translator-profile-cell">
<a href="https://github.com/veronicahuang2977">
<img alt="Translator: yuyanhuang" class="profile-img" src="../assets/avatar/avatar_yuyanhuang.jpg"/>
<img alt="Translator: yuyanhuang" class="profile-img" height="512" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/f2c06730dacd8659/avatar_yuyanhuang.webp" width="512"/>
<br/>
<b>
Yuyan Huang
@@ -457,7 +486,7 @@
<div class="profile-div">
<div class="profile-cell">
<a href="https://github.com/coderonion">
<img alt="Reviewer: coderonion" class="profile-img" src="../assets/avatar/avatar_coderonion.jpg"/>
<img alt="Reviewer: coderonion" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/db606f27971eae34/avatar_coderonion.webp" width="384"/>
<br/>
<b>
coderonion
@@ -470,7 +499,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/curtishd">
<img alt="Reviewer: curtishd" class="profile-img" src="../assets/avatar/avatar_curtishd.jpg"/>
<img alt="Reviewer: curtishd" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/feedb0e547ea31fc/avatar_curtishd.webp" width="384"/>
<br/>
<b>
curtishd
@@ -483,7 +512,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/Gonglja">
<img alt="Reviewer: Gonglja" class="profile-img" src="../assets/avatar/avatar_Gonglja.jpg"/>
<img alt="Reviewer: Gonglja" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/cdcf023b032b8d30/avatar_Gonglja.webp" width="384"/>
<br/>
<b>
Gonglja
@@ -496,7 +525,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/gvenusleo">
<img alt="Reviewer: gvenusleo" class="profile-img" src="../assets/avatar/avatar_gvenusleo.jpg"/>
<img alt="Reviewer: gvenusleo" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/464e2d351b9263ec/avatar_gvenusleo.webp" width="384"/>
<br/>
<b>
gvenusleo
@@ -509,7 +538,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/hpstory">
<img alt="Reviewer: hpstory" class="profile-img" src="../assets/avatar/avatar_hpstory.jpg"/>
<img alt="Reviewer: hpstory" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/7b6478acdab6b845/avatar_hpstory.webp" width="384"/>
<br/>
<b>
hpstory
@@ -522,7 +551,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/justin-tse">
<img alt="Reviewer: justin-tse" class="profile-img" src="../assets/avatar/avatar_justin-tse.jpg"/>
<img alt="Reviewer: justin-tse" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/208ee5aae490eefa/avatar_justin-tse.webp" width="384"/>
<br/>
<b>
justin-tse
@@ -535,7 +564,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/khoaxuantu">
<img alt="Reviewer: khoaxuantu" class="profile-img" src="../assets/avatar/avatar_khoaxuantu.jpg"/>
<img alt="Reviewer: khoaxuantu" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/9d3f1a21ff51de78/avatar_khoaxuantu.webp" width="384"/>
<br/>
<b>
khoaxuantu
@@ -548,7 +577,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/krahets">
<img alt="Reviewer: krahets" class="profile-img" src="../assets/avatar/avatar_krahets.jpg"/>
<img alt="Reviewer: krahets" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/e321f9a3ac2739e0/avatar_krahets.webp" width="384"/>
<br/>
<b>
krahets
@@ -561,7 +590,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/night-cruise">
<img alt="Reviewer: night-cruise" class="profile-img" src="../assets/avatar/avatar_night-cruise.jpg"/>
<img alt="Reviewer: night-cruise" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/960b489efa22abd4/avatar_night-cruise.jpg" width="384"/>
<br/>
<b>
night-cruise
@@ -574,7 +603,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/nuomi1">
<img alt="Reviewer: nuomi1" class="profile-img" src="../assets/avatar/avatar_nuomi1.jpg"/>
<img alt="Reviewer: nuomi1" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/7316a9eb4429b259/avatar_nuomi1.webp" width="384"/>
<br/>
<b>
nuomi1
@@ -587,7 +616,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/Reanon">
<img alt="Reviewer: Reanon" class="profile-img" src="../assets/avatar/avatar_Reanon.jpg"/>
<img alt="Reviewer: Reanon" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/dcc15aa68cc793c7/avatar_Reanon.webp" width="384"/>
<br/>
<b>
Reanon
@@ -600,7 +629,7 @@
</div>
<div class="profile-cell">
<a href="https://github.com/rongyi">
<img alt="Reviewer: rongyi" class="profile-img" src="../assets/avatar/avatar_rongyi.jpg"/>
<img alt="Reviewer: rongyi" class="profile-img" height="384" loading="lazy" src="../assets/home/ad8bb1cc4c28091c/../shared/images/5dc6c4b1d8bfe0ac/avatar_rongyi.webp" width="384"/>
<br/>
<b>
rongyi
@@ -621,11 +650,13 @@
Книга постоянно совершенствуется благодаря совместным усилиям более чем 200 участников сообщества. Спасибо им за время и вклад!
</p>
<a href="https://github.com/krahets/hello-algo/graphs/contributors">
<img alt="Contributors" src="https://contrib.rocks/image?repo=krahets/hello-algo&amp;max=300&amp;columns=12" style="width: 100%; max-width: 38.5em;"/>
<img alt="Contributors" loading="lazy" src="https://contrib.rocks/image?repo=krahets/hello-algo&amp;max=300&amp;columns=12" style="width: 100%; max-width: 38.5em;"/>
</a>
</div>
</div>
</section>
<script defer="" onerror="document.querySelectorAll('[data-home-src], [data-home-poster]').forEach(function(el) { if (el.dataset.homeSrc) el.src = el.dataset.homeSrc; if (el.dataset.homePoster) el.poster = el.dataset.homePoster; });" src="../assets/home/ad8bb1cc4c28091c/javascripts/homepage-media.js">
</script>
<main class="md-main" data-md-component="main" style="height: 0;">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" hidden="">
@@ -1945,7 +1976,7 @@
document.addEventListener('DOMContentLoaded', applyLandingPalette, { once: true });
})();
</script>
<script src="javascripts/starfield.js">
<script data-home-scene="" src="../assets/home/ad8bb1cc4c28091c/javascripts/starfield.js">
</script>
<script>
Starfield.setup({

View File

@@ -301,4 +301,4 @@
initAutoSlide();
}
})();
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */

File diff suppressed because one or more lines are too long

View File

@@ -8,4 +8,4 @@ document$.subscribe(({ body }) => {
],
});
});
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */

View File

@@ -15,4 +15,4 @@ window.MathJax = {
document$.subscribe(() => {
MathJax.typesetPromise();
});
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */

View File

@@ -1,472 +0,0 @@
/*
* starfield.js
*
* Version: 1.5.0
* Description: Interactive starfield background
*
* Usage:
* Starfield.setup({
* // options
* });
*/
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define([], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory();
} else {
root.Starfield = factory();
}
})(this, function () {
const Starfield = {};
const config = {
numStars: 250, // Number of stars
baseSpeed: 1, // Base speed of stars (will affect acceleration)
trailLength: 0.8, // Length of star trail (0-1)
starColor: "rgb(255, 255, 255)", // Color of stars (only rgb)
canvasColor: "rgb(30, 30, 30)", // Canvas background color (only rgb)
hueJitter: 0, // Maximum hue variation in degrees (0-360)
maxAcceleration: 10, // Maximum acceleration
accelerationRate: 0.2, // Rate of acceleration
decelerationRate: 0.2, // Rate of deceleration
minSpawnRadius: 80, // Minimum spawn distance from origin
maxSpawnRadius: 500, // Maximum spawn distance from origin
auto: true,
originX: null,
originY: null,
container: null,
originElement: null,
};
let stars = [];
let accelerate = false;
let accelerationFactor = 0;
let originX = 0;
let originY = 0;
let prevOriginX = 0;
let prevOriginY = 0;
let canvas, ctx;
let width, height;
let lastTimestamp = 0;
let canvasRGB = [0, 0, 0];
let lastCanvasColor = config.canvasColor;
let origin;
let container;
const mouseEnterHandler = () => (accelerate = true);
const mouseLeaveHandler = () => (accelerate = false);
const resizeHandler = () => windowResized(container, origin);
function visibilityHandler() {
if (document.visibilityState === "visible") {
lastTimestamp = performance.now();
}
}
function getOriginY(origin, container) {
const originRect = origin.getBoundingClientRect();
const containerRect = container.getBoundingClientRect();
return originRect.top - containerRect.top + originRect.height / 2;
}
function getOriginX(origin, container) {
const originRect = origin.getBoundingClientRect();
const containerRect = container.getBoundingClientRect();
return originRect.left - containerRect.left + originRect.width / 2;
}
/**
* Set up and start the starfield animation.
* @param {Object} userConfig Configuration options.
*/
function setup(userConfig = {}) {
Object.assign(config, userConfig);
container = config.container || document.querySelector(".starfield");
if (!container) {
throw new Error("Starfield: No container element found.");
}
// container.style.position = "relative";
width = container.clientWidth;
height = container.clientHeight;
canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
canvas.style.position = "absolute";
canvas.style.top = "0";
canvas.style.left = "0";
canvas.style.width = "100%";
canvas.style.height = "100%";
canvas.style.zIndex = "-1";
canvasRGB = parseRGBA(config.canvasColor);
container.appendChild(canvas);
ctx = canvas.getContext("2d");
if (config.auto) {
origin =
config.originElement || document.querySelector(".starfield-origin");
if (!origin) {
throw new Error("Starfield: No origin element found.");
}
originX = getOriginX(origin, container);
originY = getOriginY(origin, container);
origin.addEventListener("mouseenter", mouseEnterHandler);
origin.addEventListener("mouseleave", mouseLeaveHandler);
window.addEventListener("resize", resizeHandler);
} else {
originX = config.originX !== null ? config.originX : width / 2;
originY = config.originY !== null ? config.originY : height / 2;
}
for (let i = 0; i < config.numStars; i++) {
const star = createRandomStar();
stars.push(star);
}
document.addEventListener("visibilitychange", visibilityHandler);
requestAnimationFrame(draw);
}
function windowResized(container, origin) {
width = container.clientWidth;
height = container.clientHeight;
canvas.width = width;
canvas.height = height;
originX = getOriginX(origin, container);
originY = getOriginY(origin, container);
stars.forEach((star) => star.reset());
}
function createRandomStar() {
const angle = random(0, Math.PI * 2);
const radius = random(config.minSpawnRadius, config.maxSpawnRadius);
const x = originX + Math.cos(angle) * radius;
const y = originY + Math.sin(angle) * radius;
return new Star(x, y);
}
class Star {
constructor(x, y) {
this.pos = {
x: x,
y: y,
};
this.prevpos = {
x: x,
y: y,
};
this.vel = {
x: 0,
y: 0,
};
this.angle = Math.atan2(y - originY, x - originX);
this.baseSpeed = random(config.baseSpeed * 0.5, config.baseSpeed * 1.5);
this.hueOffset = random(-config.hueJitter, config.hueJitter);
}
reset() {
const newStar = createRandomStar();
this.pos.x = newStar.pos.x;
this.pos.y = newStar.pos.y;
this.prevpos.x = this.pos.x;
this.prevpos.y = this.pos.y;
this.vel.x = 0;
this.vel.y = 0;
this.angle = Math.atan2(this.pos.y - originY, this.pos.x - originX);
this.baseSpeed = random(config.baseSpeed * 0.5, config.baseSpeed * 1.5);
this.hueOffset = random(-config.hueJitter, config.hueJitter);
}
update(acc, deltaTime) {
const adjustedAcc = acc * this.baseSpeed;
this.vel.x += Math.cos(this.angle) * adjustedAcc * deltaTime;
this.vel.y += Math.sin(this.angle) * adjustedAcc * deltaTime;
this.prevpos.x = this.pos.x;
this.prevpos.y = this.pos.y;
this.pos.x += this.vel.x * deltaTime;
this.pos.y += this.vel.y * deltaTime;
}
draw() {
let velMag = Math.sqrt(
this.vel.x * this.vel.x + this.vel.y * this.vel.y
);
velMag = velMag * 3;
const alpha = map(velMag, 0, 10, 0, 1);
const weight = map(velMag, 0, 10, 1, 3);
ctx.lineWidth = weight;
const [r, g, b] = parseRGBA(config.starColor);
const [h, s, l] = rgbToHsl(r, g, b);
const adjustedH = (h + this.hueOffset + 360) % 360;
const [newR, newG, newB] = hslToRgb(adjustedH, s, l).map((v) =>
Math.round(v)
);
ctx.strokeStyle = `rgba(${newR}, ${newG}, ${newB}, ${alpha})`;
ctx.beginPath();
ctx.moveTo(this.prevpos.x, this.prevpos.y);
ctx.lineTo(this.pos.x, this.pos.y);
ctx.stroke();
}
isActive() {
return onScreen(this.pos.x, this.pos.y);
}
updateAngle() {
this.angle = Math.atan2(this.pos.y - originY, this.pos.x - originX);
}
}
function draw(timestamp) {
if (!lastTimestamp) lastTimestamp = timestamp;
const deltaTime = (timestamp - lastTimestamp) / 16.67;
lastTimestamp = timestamp;
if (config.auto) {
originX = getOriginX(origin, container);
originY = getOriginY(origin, container);
if (originX !== prevOriginX || originY !== prevOriginY) {
stars.forEach((star) => {
star.updateAngle();
});
prevOriginX = originX;
prevOriginY = originY;
}
}
if (lastCanvasColor !== config.canvasColor) {
canvasRGB = parseRGBA(config.canvasColor);
lastCanvasColor = config.canvasColor;
}
const [bgR, bgG, bgB] = canvasRGB;
ctx.fillStyle = `rgba(${bgR}, ${bgG}, ${bgB}, ${1 - config.trailLength})`;
ctx.fillRect(0, 0, width, height);
if (accelerate) {
accelerationFactor = Math.min(
accelerationFactor + config.accelerationRate * deltaTime,
config.maxAcceleration
);
} else {
accelerationFactor = Math.max(
accelerationFactor - config.decelerationRate * deltaTime,
0
);
}
const baseAcc = 0.01;
const currentAcc = baseAcc * (1 + accelerationFactor * 10);
for (let star of stars) {
star.update(currentAcc, deltaTime);
star.draw();
if (!star.isActive()) {
star.reset();
}
}
requestAnimationFrame(draw);
}
function onScreen(x, y) {
return x >= 0 && x <= width && y >= 0 && y <= height;
}
function random(min, max) {
return Math.random() * (max - min) + min;
}
// https://gist.github.com/mjackson/5311256
function rgbToHsl(r, g, b) {
r /= 255;
g /= 255;
b /= 255;
const max = Math.max(r, g, b),
min = Math.min(r, g, b);
let h,
s,
l = (max + min) / 2;
if (max === min) {
h = s = 0;
} else {
const d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return [h * 360, s, l];
}
// https://gist.github.com/mjackson/5311256
function hslToRgb(h, s, l) {
let r, g, b;
h = h / 360;
if (s === 0) {
r = g = b = l;
} else {
const hue2rgb = (p, q, t) => {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
};
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q;
r = hue2rgb(p, q, h + 1 / 3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1 / 3);
}
return [r * 255, g * 255, b * 255];
}
function parseRGBA(color) {
const rgbaRegex = /rgba?\((\d+),\s*(\d+),\s*(\d+)/;
const match = color.match(rgbaRegex);
if (match) {
return [
parseInt(match[1], 10),
parseInt(match[2], 10),
parseInt(match[3], 10),
];
}
return [255, 255, 255];
}
function map(value, start1, stop1, start2, stop2) {
return ((value - start1) / (stop1 - start1)) * (stop2 - start2) + start2;
}
/**
* Set the acceleration state of the starfield.
* @param {boolean} state The acceleration state.
*/
function setAccelerate(state) {
accelerate = state;
}
/**
* Set the x-coordinate of the origin of the starfield.
* @param {number} x The x-coordinate of the origin.
*/
function setOriginX(x) {
originX = x;
stars.forEach((star) => {
star.angle = Math.atan2(star.pos.y - originY, star.pos.x - originX);
});
}
/**
* Set the y-coordinate of the origin of the starfield.
* @param {number} y The y-coordinate of the origin.
*/
function setOriginY(y) {
originY = y;
stars.forEach((star) => {
star.angle = Math.atan2(star.pos.y - originY, star.pos.x - originX);
});
}
/**
* Set the origin of the starfield to a specific point.
* @param {number} x The x-coordinate of the origin.
* @param {number} y The y-coordinate of the origin.
*/
function setOrigin(x, y) {
originX = x;
originY = y;
stars.forEach((star) => {
star.angle = Math.atan2(star.pos.y - originY, star.pos.x - originX);
});
}
/**
* Resize the starfield to a new width and height.
* @param {number} newWidth The new width of the starfield.
* @param {number} newHeight The new height of the starfield.
*/
function resize(newWidth, newHeight) {
width = newWidth;
height = newHeight;
canvas.width = width;
canvas.height = height;
if (config.originY !== null) {
originY = config.originY;
} else {
originY = height / 2;
}
stars.forEach((star) => star.reset());
}
function cleanup() {
if (origin) {
origin.removeEventListener("mouseenter", mouseEnterHandler);
origin.removeEventListener("mouseleave", mouseLeaveHandler);
}
window.removeEventListener("resize", resizeHandler);
document.removeEventListener("visibilitychange", visibilityHandler);
if (canvas && canvas.parentNode) {
canvas.parentNode.removeChild(canvas);
}
stars = [];
accelerate = false;
accelerationFactor = 0;
originX = 0;
originY = 0;
prevOriginX = 0;
prevOriginY = 0;
lastTimestamp = 0;
}
Starfield.setup = setup;
Starfield.setAccelerate = setAccelerate;
Starfield.setOrigin = setOrigin;
Starfield.setOriginX = setOriginX;
Starfield.setOriginY = setOriginY;
Starfield.resize = resize;
Starfield.config = config;
Starfield.cleanup = cleanup;
return Starfield;
});
/*! update cache: 20261030195506 */

View File

@@ -134,7 +134,7 @@
}
[data-md-color-scheme="slate"] .animation-controls {
background: color-mix(in srgb, var(--md-code-bg-color) 91%, black 9%);
background: var(--md-code-bg-color);
}
[data-md-color-scheme="slate"] .animation-controls__button:hover,
@@ -148,7 +148,7 @@
}
[data-md-color-scheme="slate"] .md-typeset .tabbed-set[data-auto-slide="true"] > .tabbed-content {
background: var(--md-code-bg-color);
background: var(--md-default-bg-color);
}
@media screen and (max-width: 44.9375em) {
@@ -176,4 +176,4 @@
font-size: 0.7rem;
}
}
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */

View File

@@ -1,3 +1,4 @@
/* Theme tokens */
/* https://github.com/squidfunk/mkdocs-material/blob/6b5035f5580f97532d664e3d1babf5f320e88ee9/src/assets/stylesheets/main/_colors.scss */
/* https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#custom-colors */
@@ -29,35 +30,71 @@
}
[data-md-color-scheme="slate"] {
--theme-dark-base: #1e1e1e;
--theme-dark-mantle: #1a1a1a;
--theme-dark-crust: #171717;
--theme-dark-base: #171717;
--theme-dark-surface: #1e1e1e;
--theme-dark-overlay: #252525;
/* Neutral reading hierarchy shared with the dark SVG palette. */
--theme-dark-text: #dcdcdc;
--theme-dark-text-strong: #eeeeee;
--theme-dark-text-secondary: #c1c1c1;
--theme-dark-text-muted: #a5a5a5;
--hero-starfield-bg-color: var(--theme-dark-base);
--md-primary-fg-color: var(--theme-dark-base);
--md-primary-bg-color: #adbac7;
--md-primary-bg-color: var(--theme-dark-text);
--md-default-fg-color: #adbac7;
--md-default-fg-color: var(--theme-dark-text);
--md-default-fg-color--light: var(--theme-dark-text-secondary);
--md-default-fg-color--lighter: rgb(220 220 220 / 0.32);
--md-default-fg-color--lightest: rgb(220 220 220 / 0.12);
--md-default-bg-color: var(--theme-dark-base);
--md-default-bg-color--light: rgb(30 30 30 / 0.8);
--md-default-bg-color--light: color-mix(in srgb, var(--theme-dark-base) 80%, transparent);
--md-body-bg-color: var(--md-default-bg-color);
--md-header-bg-color: rgba(26, 26, 26, 0.8);
--md-header-bg-color: var(--md-default-bg-color--light);
--md-code-fg-color: #adbac7;
--md-code-bg-color: var(--theme-dark-crust);
--md-code-fg-color: var(--theme-dark-text);
--md-code-hl-comment-color: var(--theme-dark-text-muted);
--md-code-hl-variable-color: var(--theme-dark-text);
--md-code-hl-punctuation-color: var(--theme-dark-text-secondary);
--md-code-hl-operator-color: var(--theme-dark-text-secondary);
--md-code-hl-generic-color: var(--theme-dark-text-secondary);
--md-code-bg-color: var(--theme-dark-surface);
--md-code-bg-color--light: color-mix(in srgb, var(--theme-dark-surface) 70%, transparent);
--md-code-bg-color--lighter: color-mix(in srgb, var(--theme-dark-surface) 30%, transparent);
--md-typeset-color: #adbac7;
--md-typeset-color: var(--theme-dark-text);
--md-typeset-a-color: #52bbb1;
--md-accent-fg-color: var(--md-typeset-a-color);
--md-typeset-btn-color: #52bbb1;
--md-typeset-btn-hover-color: #55aea6;
--md-footer-fg-color: #adbac7;
--md-footer-bg-color: var(--theme-dark-mantle);
--md-footer-fg-color: var(--theme-dark-text-secondary);
--md-footer-bg-color: var(--theme-dark-base);
--md-footer-bg-color--dark: var(--theme-dark-base);
--md-admonition-pythontutor-color: var(--md-code-bg-color);
/* Search uses RGB channels inside its shadow root. */
--color-foreground: 220 220 220;
--color-background: 37 37 37;
--color-background-subtle: 30 30 30;
--color-backdrop: 23 23 23;
}
[data-md-color-scheme="slate"] .md-typeset :is(h1, h2, h3, h4, h5, h6) {
color: var(--theme-dark-text-strong);
}
[data-md-color-scheme="slate"] :is(.md-select__inner, .md-tooltip, .md-tooltip2__inner) {
--md-default-bg-color: var(--theme-dark-overlay);
background-color: var(--theme-dark-overlay);
}
[data-md-color-scheme="slate"] .md-dialog {
background-color: var(--theme-dark-overlay);
color: var(--md-default-fg-color);
}
[data-md-color-scheme="slate"][data-md-color-primary="black"],
@@ -75,7 +112,7 @@ body {
}
html:has(body[data-md-color-scheme="slate"]) {
background-color: #1e1e1e;
background-color: #171717;
}
html:has(body[data-md-color-scheme="default"]) {
@@ -352,6 +389,14 @@ html:has(body[data-md-color-scheme="default"]) {
padding-top: 0.4rem;
}
[data-md-color-scheme="slate"] .md-typeset :is(.admonition, details):not(.pythontutor) {
background-color: var(--theme-dark-surface);
}
[data-md-color-scheme="slate"] .md-typeset :is(.admonition, details):not(.pythontutor) > :is(.admonition-title, summary) {
background-color: color-mix(in srgb, var(--hello-algo-callout-color) 10%, var(--theme-dark-surface));
}
[dir="ltr"] .md-typeset :is(.admonition, details):not(.pythontutor) > :is(.admonition-title, summary) {
padding-left: 2.4rem;
}
@@ -393,12 +438,6 @@ html:has(body[data-md-color-scheme="default"]) {
mask-image: var(--md-admonition-icon--pythontutor);
}
[data-md-color-scheme="slate"] .md-typeset details.pythontutor[open]> :not(summary),
[data-md-color-scheme="slate"] .md-typeset details.pythontutor[open]> :not(summary) :is(p, li, strong, em, sub, sup, code, a) {
background-color: #f5f5f5;
color: #1d1d20;
}
.md-typeset .tabbed-labels>label {
font-size: 0.61rem;
}
@@ -408,6 +447,8 @@ html:has(body[data-md-color-scheme="default"]) {
}
.pythontutor-iframe {
/* The embedded third-party visualizer has its own light canvas. */
background-color: #f5f5f5;
width: 125%;
height: 125%;
max-width: 125% !important;
@@ -441,7 +482,7 @@ html:has(body[data-md-color-scheme="default"]) {
}
.home-div--black {
background-color: #101010;
background-color: var(--theme-dark-base, #171717);
}
.home-div[data-md-color-scheme="default"],
@@ -812,7 +853,7 @@ a:hover .device-on-hover {
margin: 0;
padding: 1.25em 2.5em;
border-radius: 28px;
background-color: #101010;
background-color: var(--theme-dark-surface, #1e1e1e);
box-sizing: border-box;
overflow: hidden;
}
@@ -996,4 +1037,4 @@ a:hover .device-on-hover {
max-width: 100%;
}
}
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */

View File

@@ -122,4 +122,4 @@ main .gsc-loading-image {
.gsc-reply-content::-webkit-scrollbar-track {
background: transparent;
}
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */

View File

@@ -153,4 +153,4 @@ main {
.gsc-reply-content::-webkit-scrollbar-track {
background: transparent;
}
/*! update cache: 20261030195506 */
/*! update cache: 20261103165928 */