mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-23 12:54:04 +00:00
[pkg] ready to publish v1.33.2
This commit is contained in:
parent
229a56f11b
commit
9140567d73
373
README.md
373
README.md
|
@ -410,6 +410,193 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
### Standard library data structure comparison
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data Structure</th>
|
||||
<th>C++ std</th>
|
||||
<th>Data Structure Typed</th>
|
||||
<th>java.util</th>
|
||||
<th>Python collections</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Dynamic Array</td>
|
||||
<td>std::vector<T></td>
|
||||
<td>Array<E></td>
|
||||
<td>ArrayList<E></td>
|
||||
<td>list</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linked List</td>
|
||||
<td>std::list<T></td>
|
||||
<td>DoublyLinkedList<E></td>
|
||||
<td>LinkedList<E></td>
|
||||
<td>deque</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Set</td>
|
||||
<td>std::set<T></td>
|
||||
<td>Set</td>
|
||||
<td>HashSet<E></td>
|
||||
<td>set</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Map</td>
|
||||
<td>std::map<K, V></td>
|
||||
<td>Map</td>
|
||||
<td>HashMap<K, V></td>
|
||||
<td>dict</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Map</td>
|
||||
<td>std::unordered_map<K, V></td>
|
||||
<td>N/A</td>
|
||||
<td>HashMap<K, V></td>
|
||||
<td>defaultdict</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Set</td>
|
||||
<td>std::unordered_set<T></td>
|
||||
<td>N/A</td>
|
||||
<td>HashSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Queue</td>
|
||||
<td>std::queue<T></td>
|
||||
<td>Queue</td>
|
||||
<td>Queue<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Priority Queue</td>
|
||||
<td>std::priority_queue<T></td>
|
||||
<td>PriorityQueue</td>
|
||||
<td>PriorityQueue<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Stack</td>
|
||||
<td>std::stack<T></td>
|
||||
<td>Stack</td>
|
||||
<td>Stack<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bitset</td>
|
||||
<td>std::bitset<N></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Deque</td>
|
||||
<td>std::deque<T></td>
|
||||
<td>Deque</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Multiset</td>
|
||||
<td>std::multiset<T></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Multimap</td>
|
||||
<td>std::multimap<K, V></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Multiset</td>
|
||||
<td>std::unordered_multiset</td>
|
||||
<td>N/A</td>
|
||||
<td>Counter</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ordered Dictionary</td>
|
||||
<td>N/A</td>
|
||||
<td>Map</td>
|
||||
<td>N/A</td>
|
||||
<td>OrderedDict</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Double-Ended Queue (Deque)</td>
|
||||
<td>std::deque<T></td>
|
||||
<td>Deque</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linked Hash Set</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>LinkedHashSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linked Hash Map</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>LinkedHashMap<K, V></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sorted Set</td>
|
||||
<td>N/A</td>
|
||||
<td>AVLTree, RBTree</td>
|
||||
<td>TreeSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sorted Map</td>
|
||||
<td>N/A</td>
|
||||
<td>AVLTree, RBTree</td>
|
||||
<td>TreeMap<K, V></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tree Set</td>
|
||||
<td>std::set</td>
|
||||
<td>AVLTree, RBTree</td>
|
||||
<td>TreeSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Persistent Collections</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>unordered multiset</td>
|
||||
<td>unordered multiset<T></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Multimap</td>
|
||||
<td>std::unordered_multimap<K, V></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
## Code design
|
||||
|
||||
By strictly adhering to object-oriented design (BinaryTree -> BST -> AVLTree -> TreeMultiset), you can seamlessly
|
||||
|
@ -678,189 +865,3 @@ optimal approach to data structure design.
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
### Standard library data structure comparison
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data Structure</th>
|
||||
<th>C++ std</th>
|
||||
<th>Data Structure Typed</th>
|
||||
<th>java.util</th>
|
||||
<th>Python collections</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Dynamic Array</td>
|
||||
<td>std::vector<T></td>
|
||||
<td>Array<E></td>
|
||||
<td>ArrayList<E></td>
|
||||
<td>list</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linked List</td>
|
||||
<td>std::list<T></td>
|
||||
<td>DoublyLinkedList<E></td>
|
||||
<td>LinkedList<E></td>
|
||||
<td>deque</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Set</td>
|
||||
<td>std::set<T></td>
|
||||
<td>Set</td>
|
||||
<td>HashSet<E></td>
|
||||
<td>set</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Map</td>
|
||||
<td>std::map<K, V></td>
|
||||
<td>Map</td>
|
||||
<td>HashMap<K, V></td>
|
||||
<td>dict</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Map</td>
|
||||
<td>std::unordered_map<K, V></td>
|
||||
<td>N/A</td>
|
||||
<td>HashMap<K, V></td>
|
||||
<td>defaultdict</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Set</td>
|
||||
<td>std::unordered_set<T></td>
|
||||
<td>N/A</td>
|
||||
<td>HashSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Queue</td>
|
||||
<td>std::queue<T></td>
|
||||
<td>Queue</td>
|
||||
<td>Queue<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Priority Queue</td>
|
||||
<td>std::priority_queue<T></td>
|
||||
<td>PriorityQueue</td>
|
||||
<td>PriorityQueue<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Stack</td>
|
||||
<td>std::stack<T></td>
|
||||
<td>Stack</td>
|
||||
<td>Stack<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bitset</td>
|
||||
<td>std::bitset<N></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Deque</td>
|
||||
<td>std::deque<T></td>
|
||||
<td>Deque</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Multiset</td>
|
||||
<td>std::multiset<T></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Multimap</td>
|
||||
<td>std::multimap<K, V></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Multiset</td>
|
||||
<td>std::unordered_multiset</td>
|
||||
<td>N/A</td>
|
||||
<td>Counter</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ordered Dictionary</td>
|
||||
<td>N/A</td>
|
||||
<td>Map</td>
|
||||
<td>N/A</td>
|
||||
<td>OrderedDict</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Double-Ended Queue (Deque)</td>
|
||||
<td>std::deque<T></td>
|
||||
<td>Deque</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linked Hash Set</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>LinkedHashSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linked Hash Map</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>LinkedHashMap<K, V></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sorted Set</td>
|
||||
<td>N/A</td>
|
||||
<td>AVLTree, RBTree</td>
|
||||
<td>TreeSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sorted Map</td>
|
||||
<td>N/A</td>
|
||||
<td>AVLTree, RBTree</td>
|
||||
<td>TreeMap<K, V></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tree Set</td>
|
||||
<td>std::set</td>
|
||||
<td>AVLTree, RBTree</td>
|
||||
<td>TreeSet<E></td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Persistent Collections</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>unordered multiset</td>
|
||||
<td>unordered multiset<T></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unordered Multimap</td>
|
||||
<td>std::unordered_multimap<K, V></td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
Loading…
Reference in a new issue