Revone
07dd75de70
test: The test cases have been added, though slightly tricky. The overall test coverage is currently at 93.27%.
2024-10-16 21:55:48 +13:00
zrwusa
bf37a4df7f
style: optimization of code style of HashMap
2024-09-19 17:20:58 +12:00
Revone
7e45aaf609
style: Prettier version updated. Code style adhered to Prettier strictly.
2024-08-27 10:56:04 +12:00
Revone
1ae9e929b1
feat: Provide the toElementFn method during instantiation for the entire data structure series, allowing the mapping of raw data to the desired data type and direct insertion of data into the data structure to be completed within a single loop.
...
fix: Override the corresponding clone, filter, and map methods in the Heap and PriorityQueue data structures, ensuring the accurate return of the respective data structures. #84 fixed.
2024-02-01 21:05:10 +08:00
Revone
02d71a23ba
Refactor: All binary tree data structures now support the toEntryFn for extracting key and value from raw data at once, avoiding users from having to traverse data multiple times, thus improving performance. Chore: Explicitly use the override keyword.
2024-01-26 18:20:15 +08:00
Revone
ba16f311c3
Refactor: Organize the access permissions of all member variables. Docs: Partial documentation for time and space complexity.
2024-01-05 15:37:28 +08:00
Revone
ecf4d6ad11
fix: Fix bug #71 .
...
feat: Define abstract methods through a base class to add clone and isEmpty methods to all data structures. Add delete and deleteAt methods to Deque, Queue, and Stack data structures.
refactor: Optimize the type definition N to NODE for alignment with the design of TREE.
2024-01-03 15:52:10 +08:00
Revone
58ea2cb3c3
docs: Complete all code comments.
2024-01-01 10:45:32 +08:00
Revone
831ad3bd98
refactor: rename method 'getAt' to 'at'
2023-12-30 20:36:11 +08:00
Revone
ff8f907192
feat: In the IterableEntryBase and IterableElementBase classes, add find, get, and has methods so that all inheriting data structures can have access to these methods. Also, override these methods in the necessary data structures as needed.
2023-12-30 18:44:24 +08:00
Revone
34d4abd9e6
fix : #38 Removed includeNull parameter from traversal methods.
...
feat: Removed unnecessary methods isNotNodeInstance and subTreeTraverse.
refactor: Organized the overloads of traversal methods.
2023-12-29 11:15:19 +08:00
Revone
689aa0f57e
feat: Provide convenient option of the raw data processing function 'toEntry' in HashMap.options.
2023-12-25 20:24:41 +08:00
Revone
c949b5b741
refactor: Rearrange constructor parameters for all data structures, with the first parameter being the output and the second parameter being a configuration object. Make all configuration object properties optional.
...
fix: Provide optional parameters for inheritable data structures to facilitate inheritance. #64
2023-12-24 17:44:55 +08:00
Revone
dc6ef95f78
style: code base reformat
2023-12-21 10:26:45 +08:00
Revone
3e97e806ba
refactor: Unify the return types of all methods and align them with Java, extract the print and hasValue methods to base class. This will make the code more consistent and easier to understand.
2023-12-12 21:14:17 +08:00
Revone
e113a99b26
fix: bug fixed #58 , DirectedGraph.getCycles returns an inexisting cycle. feat: hasValue method for HashMap.
2023-12-12 09:57:30 +08:00
Revone
f0927e8b0a
docs: Wrote a feature description for each data structure. refactor: Standardize the import of all types and objects
2023-12-11 20:27:05 +08:00
Revone
60a3154178
refactor: Differentiate between type imports and regular object imports.
2023-12-11 14:14:46 +08:00
Revone
a02a9a94d2
refactor: Rewrite the lastKey method. The BinaryTree.add method filters out duplicate additions. Rename popLast and popFirst to pollLast and pollFirst.
2023-12-07 19:34:20 +08:00
Revone
1b1d5c6669
feat: The add method of the binary tree is compatible with the multi-parameter mode of add(key, value), and it is also compatible with the entry method.
2023-12-07 09:16:25 +08:00
Revone
7f5eb6cb70
refactor: Extract all methods such as 'some', 'every', 'entries', 'keys', 'values', 'forEach', 'reduce' into the base classes 'IterableElementBase' and 'IterablePairBase'.
2023-12-02 22:15:18 +08:00
Revone
87ea490458
feat: print method has been added in HashMap. chore: reformated HashMap test. docs: high-performance HashMap benchmark
2023-11-30 10:20:12 +08:00
Revone
65949b7d19
feat: Reimplement a more efficient HashMap and correctly rename the original HashMap as LinkedHashMap.
2023-11-30 09:59:01 +08:00
Revone
982152abc0
fix: type fixed
2023-11-25 22:33:38 +08:00
Revone
f9f9df81f5
feat: Perfectly implement fast conversion between data structures. Implement a getter size for Trie. docs: Add comments to the 'add' and 'addMany' methods of all binary tree data structures.
2023-11-25 22:32:09 +08:00
Revone
5cf88d098e
feat: All data structures except Graph have implemented *[Symbol.iterator], forEach, filter, map, reduce methods.
2023-11-23 13:19:13 +08:00
Revone
3205f90cf6
docs: Reorganize some content in the README
2023-11-22 19:00:06 +08:00
Revone
d3a6bdac25
fix: type error fixed. docs: Remove unnecessary 'Software Engineering Design Standards'.
2023-11-20 15:14:13 +08:00
Revone
7c6e5d3b1c
refactor: HashMap supports custom hash functions.
2023-11-20 13:03:39 +08:00
Revone
1e2013df5e
refactor: Eliminate unnecessary data structures. test: Add performance comparison tests with native Map and Set.
2023-11-20 09:51:34 +08:00
Revone
b4e89d9f72
refactor: Discard the unnecessary Iterator class in Deque and HashMap, and instead implement using Generators.
2023-11-19 21:09:44 +08:00
Revone
5c6803b1a9
docs: Deque docs enriched, big o notations
2023-11-19 08:56:37 +08:00
Revone
2634c99388
feat: high-performance Deque implemented
2023-11-17 22:37:35 +08:00
Revone
be6ad5473b
style: Change ESLint configuration from error type to warning type. Format the code.
2023-11-16 11:55:40 +08:00
Revone
dd2701dab7
style: reformated codebase
2023-11-16 10:14:14 +08:00
Revone
bac0964ac2
fix: Implemented a high-performance HashMap comparable to the native Map. All test cases are standardized using 'it' instead of 'test'. Enabled tsconfig's sourceMap configuration for correct line numbers in IDE testing.
2023-11-15 23:17:55 +08:00
Revone
8f1f6d6f52
style: Try to synchronize Prettier with the coding style of the IDE.
2023-11-13 22:27:29 +08:00
Revone
1064ad4a58
style: reformat code with IDE
2023-11-13 13:07:28 +08:00
Revone
c82190764e
[rbtree, binary-tree] Further testing of the Red-Black Tree is required. The 'get' method in BinaryTree should be renamed to 'getNode,' and an additional 'get' method should be added.
2023-11-01 13:48:01 +08:00
Revone
8712bbd3c9
[core] All data structures have had their member variables access control optimized.
2023-10-31 11:15:39 +08:00
Revone
1ec5a19172
[core] Besides Binary Trees and Graphs, access control optimizations have been applied to member variables.
2023-10-31 10:34:41 +08:00
Revone
121516f303
[core] Rename all 'val' variables to 'value'.
2023-10-30 20:27:08 +08:00
Revone
bf5b865e2c
[binary-tree] bug fix#27
2023-10-30 11:14:41 +08:00
Revone
f87e682f26
[test] test coverage enriched to 90.37%
2023-10-29 21:52:27 +08:00
Revone
bd1720973a
[test] Increase the test coverage to 89.51.
2023-10-28 23:54:27 +08:00
Revone
af23af911a
[binary-tree] renamed _loopType to _iterationType
2023-10-27 17:17:27 +08:00
Revone
8df45c5c52
[binary-tree] Dynamically infer traversal method return values based on callback function results.
2023-10-25 21:09:11 +08:00
Revone
e45854d3f4
[project] Optimize the build configuration to be compatible with both earlier and later versions of Node.js. Switch to using tsup for UMD module output. Format code using an IDE.
2023-10-25 15:51:50 +08:00
Revone
063b702236
[project] Achieve a rational subpackage structure that enables individual subpackages to be independently exportable.
2023-10-25 11:19:03 +08:00
Revone
a6329163f7
1. No need for dfsIterative; integrate it directly into the dfs method. 2. Allow for public configuration of setLoopType. 3. Replace subTreeAdd with subTreeForeach for improved clarity and flexibility; provide a callback for enhanced versatility. 4. Standardize the naming of certain methods and parameters.
2023-10-21 20:03:54 +08:00