235 Commits

Author SHA1 Message Date
7e904c8ff6 Update counting_sort.py (#1677)
Since the max function is called to find the maximum value, it doesn't seem necessary to traverse the list and call the max function several times to select the larger value.
2025-03-09 06:39:32 +08:00
Rui
1a8b4f6364 Update linkedlist_deque.py (#1625)
According to PEP 8, "Comparisons to singletons like None should always be done with is or is not, never the equality operators."
2025-01-21 18:46:41 +08:00
57cf6b1ea6 fix some typos (#1540) 2024-10-31 21:26:28 +08:00
3f4220de81 Bug fixes and improvements (#1380)
* preorder, inorder, postorder -> pre-order, in-order, post-order

* Bug fixes

* Bug fixes

* Update what_is_dsa.md

* Sync zh and zh-hant versions

* Sync zh and zh-hant versions.

* Update performance_evaluation.md and time_complexity.md

* Add @khoaxuantu to the landing page.

* Sync zh and zh-hant versions

* Add @ khoaxuantu to the landing page of zh-hant and en versions.
2024-05-31 16:39:06 +08:00
21be3fdaf8 [Rust] Normalize mid calculation in case overflow (#1363)
* Normalize mid calculate in case overflow

* Change ALL language

* Update merge_sort.py

* Update merge_sort.zig

* Update binary_search_tree.zig

* Update binary_search_recur.py

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-05-18 18:19:19 +08:00
870e3e5cb2 Bug fixes and improvements (#1318)
* Sync zh and zh-hant versions

* Update en/README.md

* Add a Q&A for chapter of introduction

* Update the callout headers

* Sync zh ang zh-hant versions

* Bug fixes
2024-04-30 15:52:05 +08:00
cfc273783b feat: Add glossary and description for "哈希集合" (#1310) 2024-04-28 22:00:25 +08:00
f616dac7da Bug fixes and improvements (#1298)
* Fix is_empty() implementation in the stack and queue chapter

* Update en/CONTRIBUTING.md

* Remove "剩余" from the state definition of knapsack problem

* Sync zh and zh-hant versions

* Update the stylesheets of code tabs

* Fix quick_sort.rb

* Fix TS code

* Update chapter_paperbook

* Upload the manuscript of 0.1 section

* Fix binary_tree_dfs.rb

* Bug fixes

* Update README

* Update README

* Update README

* Update README.md

* Update README

* Sync zh and zh-hant versions

* Bug fixes
2024-04-22 02:26:32 +08:00
034ee65e9a Fix bugs and harmonize the code comments (#1199)
* Fix the comment in array_deque.go

* Fix the comment in bucket_sort.c

* Translate the Java code comments to Chinese

* Bug fixes

* 二分查找 -> 二分搜尋

* Harmonize comments in `utils` between multiple programming languages
2024-03-31 03:06:41 +08:00
3ea91bda99 fix: Use int instead of float for the example code of log time complexity (#1164)
* Use int instead of float for the example code of log time complexity

* Bug fixes

* Bug fixes
2024-03-23 02:17:48 +08:00
300a781fab Update code comment of quadratic in time_complexity (#1155) 2024-03-19 02:28:16 +08:00
9769e14017 Fix the median_three mehod for quick sort (#1134)
* Add the section of terminologies.

* fix format

* Fix median_three function for quick sort

* Delete docs/chapter_appendix/terminologies.md

* Update quick_sort.ts

* Update quick_sort.rs

* Update quick_sort.js
2024-03-15 01:06:59 +08:00
a005c6ebd3 Some improvements (#1073)
* Update avatar's link in the landing page

* Bug fixes

* Move assets folder from overrides to docs

* Reduce figures' corner radius

* Update copyright

* Update header image

* Krahets -> krahets

* Update the landing page
2024-02-07 22:21:18 +08:00
f6976978dd Prepare 1.0.0 release (#1044)
* Update the book with the thrid revised edition

* Fix a typo

* Update the contributors' information

* Update the mindmap

* Update the version number
2024-01-14 03:16:20 +08:00
b9ae4ffe9a feature: add auto-build-and-test workflow for go (#1019)
* fix(csharp): unified array statement

* feature: add workflow for go/js/ts/zig

* fix python UnicodeDecodeError on windows

* Update space_complexity.go

* Update space_complexity_test.go

* Update space_complexity.go

* remove nodejs, zip workflow

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-01-12 14:17:21 +08:00
ee485372fe feat: Add pythontutor blocks to the rest of the chapters (#1030)
* Fix Python code

* Add the pythontutor blocks of the chapter tree, heap, graph, searching, sorting, divide and conquer, dynamic programming and greedy.
Improve the pythontutor blocks of the chapter array and linkedlist and backtracking.
Add the tutorial of pythontutor in how-to-read section.

* Reduce the image's file size.
2024-01-07 23:49:26 +08:00
ddd375af20 feat: Add visualizing code blocks based on the pythontutor (#1029)
* Update copyright

* Update the Python code

* Fix the code comments in ArrayBinaryTree

* Fix the code comments in ArrayBinaryTree

* Roll back time_comlexity.py

* Add the visualizing code(pythontutor) blocks to the chapter complexity, data structure, array and linked list, stack and queue, hash table, and backtracking

* Fix the code comments
2024-01-07 04:04:01 +08:00
f68bbb0d59 Update the book based on the revised second edition (#1014)
* Revised the book

* Update the book with the second revised edition

* Revise base on the manuscript of the first edition
2023-12-28 18:06:09 +08:00
ed4de4644f Revised the book. (#987) 2023-12-14 02:42:53 +08:00
e720aa2d24 feat: Revised the book (#978)
* Sync recent changes to the revised Word.

* Revised the preface chapter

* Revised the introduction chapter

* Revised the computation complexity chapter

* Revised the chapter data structure

* Revised the chapter array and linked list

* Revised the chapter stack and queue

* Revised the chapter hashing

* Revised the chapter tree

* Revised the chapter heap

* Revised the chapter graph

* Revised the chapter searching

* Reivised the sorting chapter

* Revised the divide and conquer chapter

* Revised the chapter backtacking

* Revised the DP chapter

* Revised the greedy chapter

* Revised the appendix chapter

* Revised the preface chapter doubly

* Revised the figures
2023-12-02 06:21:34 +08:00
fcbaf101a4 Several bug fixes and improvements (#945)
* Update Dockerfile for code debugging.

* Format Python code using Black.

* Improve dark theme by defining html classes for the figures, animations and cover images.

* Fix several glossary translation.

* Update a code comment.

* Fix climbing_stairs_backtrack: the pruning should not require the sorted choices list.

* Update the code of array and list traversal.

* Fix a rendering issue of README.md

* Update code of list traversal.

* Fix array_definition.png

* Update README.md

* Fix max_capacity_moving_short_board.png

* Fix array.dart

* Fix array.dart

* Fix array.dart

* Fix array.dart
2023-11-14 21:27:35 +08:00
5f3ad1ed3d A few bug fixes. 2023-11-03 22:48:43 +08:00
23cce00e09 Fix Python build check script. (#911)
* Fix Python build check script.

* Update python code check workflow

* Update python test script.

* Compatible with Python >=3.9

* Compatible with Python >=3.10

* Fix errors in Windows

* test

* Add Python version in installation.md

* Update test_all.py
2023-11-02 21:58:14 +08:00
355cc3a6b1 Bug fixes to C code. 2023-11-01 05:14:22 +08:00
db5d1d21f3 Several bug fixes. 2023-10-29 00:09:54 +08:00
5b1a219b8b Fine-tune code and texts. 2023-10-27 01:01:21 +08:00
e441ee4e35 Re-implement merge sort function. (#888) 2023-10-26 02:56:33 +08:00
7822bf9cd4 feat: add top_k.c and refactor top_k.js (#889)
* Add top_k.c based on my_heap.c

* Improve the implementation of top_k.js

* Add a comment to top_k
2023-10-26 02:54:19 +08:00
17252b53a9 Format code and docs. 2023-10-24 16:19:29 +08:00
d27890d98d Fix automating build workflow for Python 2023-10-23 16:06:33 +08:00
b7c110e5ec Add build check with py_compile 2023-10-23 06:02:34 +08:00
5aacf2dfe0 Improve Python code for importing modules. 2023-10-19 16:21:51 +08:00
346c8451de Fix code naming style. 2023-10-15 21:18:09 +08:00
ada37fd1f8 Fix Python code. 2023-10-14 22:15:02 +08:00
2976d9ff56 Fix Python code. 2023-10-14 21:54:47 +08:00
a8c624fa5a Fix the code in min_path_sum 2023-10-14 03:25:11 +08:00
da5ef293d9 fix a typo 2023-10-11 17:39:56 +08:00
fb552987f5 Update variable names in list and my_list 2023-10-09 18:20:42 +08:00
4355f8d49f Several bug fixes. 2023-10-04 02:30:31 +08:00
ff8e7ceec5 Several bug fixes. 2023-09-24 20:38:21 +08:00
a46b482951 Refactor the hash_map_open_addressing implementation with lazy reallocation. (#776) 2023-09-21 04:43:15 -05:00
9f59c572b5 fine tune 2023-09-17 01:13:15 +08:00
cb9c14f5ff fix build_tree, binary_search_tree.cs
fix two figures
2023-09-15 02:08:09 +08:00
d190dbf3c1 Several enhancements and fixes 2023-09-14 03:36:31 +08:00
a9d70e9e4b fix: raise error in peek() function of linkedlist_stack.py, linkedlist_queue.py, linkedlist_deque.py (#754)
* fix: linkedlist_stack.py 中的peek方法需要判空raise Error

栈空的时候不能再 peek() 。另外由于 pop() 复用了 peek() ,栈空时返回的 None 会传递到 pop() 中的 num ,导致后续的继续执行 
 self.peek.next 报错等后续问题

* Update linkedlist_stack.py

* Update linkedlist_queue.py

* Update linkedlist_deque.py

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-14 01:22:53 +08:00
5f814d6538 Add comparison between iteration and recursion.
Fix the figure of tail recursion.
Fix two links.
2023-09-12 00:56:59 +08:00
f71b2a40da fix preorder_traversal_iii_compact code 2023-09-09 00:51:00 +08:00
dd72335235 Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
a47a974a6a fix climbing_stairs_constraint_dp code 2023-08-31 02:31:58 +08:00
628d8a516b fix binary_search_tree code 2023-08-31 02:31:31 +08:00