diff --git a/package.json b/package.json index 441ed2d..81d99c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "data-structure-typed", - "version": "1.49.3", + "version": "1.49.4", "description": "Data Structures of Javascript & TypeScript. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python", "main": "dist/cjs/index.js", "module": "dist/mjs/index.js", diff --git a/test/unit/data-structures/graph/abstract-graph.test.ts b/test/unit/data-structures/graph/abstract-graph.test.ts index 502b2b6..6c634b6 100644 --- a/test/unit/data-structures/graph/abstract-graph.test.ts +++ b/test/unit/data-structures/graph/abstract-graph.test.ts @@ -66,6 +66,17 @@ class MyGraph< return edge ? undefined : undefined; } + deleteVertex(vertexOrKey: VertexKey | VO): boolean { + let vertexKey: VertexKey; + if (this.isVertexKey(vertexOrKey)) { + vertexKey = vertexOrKey; + } else { + vertexKey = vertexOrKey.key; + } + this._vertexMap.delete(vertexKey); + return true; + } + protected _addEdge(edge: EO): boolean { return edge ? true : true; }