Commit graph

64 commits

Author SHA1 Message Date
Revone 20550fb718 feat: Implement the [Symbol.iterator], forEach, filter, map, and reduce methods for Graph, specifically targeting the nodes. fix: type error fixed 2023-11-27 11:24:23 +08:00
Revone f3df66eef3 refactor: In Graph data structures, only use 'undefined' and abandon the design where both 'null' and 'undefined' coexist. 2023-11-26 20:11:29 +08:00
Revone 8f9eb82bfd feat: To support conversion between data structures, Heap, PriorityQueue, Queue, Deque, SinglyLinkedList, DoublyLinkedList, and Stack have all added an 'elements' parameter for initializing the elements of the data structure. 2023-11-23 18:40:30 +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 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 fd416c5d6e docs: Almost all methods of data structures have added comments on time and space complexity. 2023-11-10 16:24:24 +08:00
Revone 8a518f95b7 [project] codebase reformated 2023-11-06 19:44:01 +08:00
Revone 25b9e1e9e4 [graph] To facilitate users who are not familiar with the Tarjan algorithm, provide the following methods: getCycles, getSCCs, getBridges, getCutVertexes, getDFNMap, and getLowMap. 2023-11-06 14:47:00 +08:00
Revone a85ea70cee [pkg] v1.41.9 published 2023-11-04 21:31:15 +08:00
Revone 62e55b84bd [graph] The getAllPathsBetween method in the [graph] provides a 'limit' parameter to control this exponential time complexity method from entering into a deadlock state. The getMinPathsBetween method, by default, calls the Dijkstra method to avoid invoking the excessively high time complexity method, getAllPathsBetween. 2023-11-04 21:23:02 +08:00
Revone 025a90a145 [graph] use 'Set' in dfs instead of 'Map' 2023-11-04 15:47:24 +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 121516f303 [core] Rename all 'val' variables to 'value'. 2023-10-30 20:27:08 +08:00
Revone fcec29f32c [graph test] edge cases enriched 2023-10-30 20:08:25 +08:00
Revone d44788bea9 [graph] Modify the data structure design of the graph to change the generics of Vertex and Edge to defaults, where it is possible to only pass the value types of Vertex and Edge for increased usability. 2023-10-30 18:27:58 +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 6c45f53f72 [heap, priority-queue, binary-indexed-tree] Heap and PriorityQueue constructors use a single object as a parameter for uniformity with the design of other data structures.
Binary Indexed Tree includes the getPrefixSum method.
2023-10-28 17:37:51 +08:00
Revone c11cc4527b [graph] The removal method in the graph data structure is standardized to 'delete' 2023-10-28 15:58:48 +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 3a86a5c37d [binary-tree, graph] Replace all code that uses Arrays as makeshift Queues with actual Queues to improve efficiency. [binary-tree] Remove most methods for calculating sums and modifying properties, adopting a generic callback-based design. [bst] Enable default batch addition in BST using sorted binary insertion to maintain tree balance as much as possible. 2023-10-21 23:56:14 +08:00
Revone 9764f2a5c6 [binary-tree, graph] In order to optimize the design of Binary Trees, unnecessary abstract classe removed, while enforcing method constraints between base classes and subclasses through interfaces. For Graph, it is necessary to use an abstract class as the base class, and interface constraints should be applied. Any data structures that are not within the scope of the plan deleted. 2023-10-17 21:06:41 +08:00
Kirk Qi dd7b641273 [heap, priority queue] Heap improved. References #123: redesigned 2023-10-15 22:09:26 +08:00
Revone f08819eb83 [core] In order to adhere to best practices, rename the DFS method and the BFS method as dfs and bfs. 2023-10-10 22:15:01 +08:00
Revone 3bffa7320c [core] rename id to key 2023-10-10 20:13:47 +08:00
Revone 45c49c99bf [core] renamed id to key 2023-10-10 19:55:52 +08:00
Revone bd25485555 [project] generic naming standardized 2023-09-26 13:50:40 +08:00
Revone ea8f993a4a [prettier] bracket spacing false 2023-09-22 10:43:16 +08:00
Revone b263262a46 [project] github workflow added. eslint added. formating code by using prettier. 2023-09-21 12:52:17 +08:00
Revone 773c970667 Establish a unified code editor encoding standard by .editorconfig file. 2023-09-12 11:15:20 +08:00
Revone 450f051138 Optimize the overall codebase and directory structure. 2023-09-12 11:10:09 +08:00
Revone c7e1887b96 v1.21.0 published 2023-09-07 22:28:00 +08:00
Revone 26ab0be17b [BinaryTree] isMergeDuplicatedNodeById removed, [MapGraph] MapGraph added 2023-09-07 21:00:22 +08:00
Revone f3b2398d20 [BinaryTree] isMergeDuplicatedNodeById removed, [MapGraph] MapGraph added 2023-09-07 21:00:10 +08:00
Revone 2d1010b352 Rework the add, addMany, and fill methods of AbstractBinaryTree. Refactor the AddMany method of TreeMultiset. Fix the bug in TreeMultiset where all Node counts become 1 after calling the perfectBalance method. Remove the unnecessary configuration of autoIncrementId. 2023-08-31 20:02:31 +08:00
Revone bd71edc536 images removed, heap docs revised 2023-08-31 00:50:23 +08:00
Revone 60e5824524 The APIs of Heap and Priority Queue got optimized 2023-08-31 00:18:13 +08:00
Revone df2f940189 Redesigned for greater coherence, TreeMultiset now inherits from AVLTree, with the 'count' member variable relocated to TreeMultiset. Revisions to the documentation have been made accordingly. 2023-08-29 20:29:53 +08:00
Revone de5a001b6a The Graph's API has been optimized. 2023-08-28 11:15:04 +08:00
Revone 363c66490a Modify all methods of BinaryTreeNode to make the val parameter optional. 2023-08-28 08:40:31 +08:00
Revone 0b330aeadd Enable adding nodes using both Vertex instances and the vertex parameter in the Graph. For adding edges, support both Edge instances and the src, dest parameter approach simultaneously. 2023-08-27 22:26:30 +08:00
Revone 2ea57d26ae For the sake of API simplicity, if val is not provided, id can be used in its place. 2023-08-24 00:01:44 +08:00
Revone 6bc894c5c1 Organized all the interfaces. Implemented the removeEdgeSrcToDest method for the Graph class. 2023-08-23 23:03:19 +08:00
Revone 849e3c6bca Test and debug the bug related to BinaryTreeNode's handling of object types.Revise the design of the constructor to incorporate abstract methods for enforcing the requirement that subclasses must implement the _createVertex and _createEdge methods. 2023-08-23 11:39:01 +08:00